CAM Chooser Application


Have you ever wanted to have a quick little "Click Here to Start XYZ" type script?  If so this is for you.



A lot of my customers find this useful in Controlled Access Mode when they don't want the applications running all the time (i.e. consuming resources), but want to give the user something easier than right clicking on the workspace menu to launch.  It even has a little bit of logic in it to center itself on the screen.

It also works great for full screen Windows deployments in non-smart card mode which as most of you know will time out after 120 seconds of sitting at the Windows login screen.

When the user clicks one of the application buttons the chooser box will disappear (as long as your application doesn't fork), and then reappear once the application exits.  If it is configured as a Critical application, when the user clicks the Restart button, the Sun Ray will cycle.  Particularly useful when launching a web browser so all the cache of the last users session are cleared out.

There are two scripts that make this happen, utsplash and utmsgbox.

utsplash will be your CAM Application and it will call the utmsgbox script.

utsplash is the script you will edit and customize.  You can also customize the icon, which is a unix pixmap. 

Hint: use /usr/dt/bin/sdtimage to convert a gif or jpeg into xpm format.

Here's an example of the customizable parts of utsplash

NOTE: This is only a part of the script. A tarball of the complete script is provided here.

#!/bin/sh
PATH=$PATH:/usr/openwin/bin:.;export PATH
# TITLE - What you want the label Title to be
TITLE="Sun Ray...Powered by Sun"
#ICON - What icon to display
ICON=170.xpm
#Width of the Greeter
WIDTH=550
#Height of the Greeter
HEIGHT=200
#Background color
BACKGROUND=white
#Font color
FOREGROUND=black
# Text for the 1st button - otherwise APP1 will be displayed
BTN1="MS Windows"
# Text for the 2nd button - otherwise APP2 will be displayed
BTN2="Firefox"
# Text for the 3rd button - otherwise Restart will be displayed
BTN3="Restart"
#
#
# Get screen information to center the box
XWID=`/usr/openwin/bin/xwininfo -root|grep Width | awk -F: '{print $2}'|sed 's/ //'`
XHGT=`/usr/openwin/bin/xwininfo -root|grep Height | awk -F: '{print $2}' |sed 's/ //'`
XCTR=`expr $XWID / 2`
YCTR=`expr $XHGT / 2`
YCUT=`expr $HEIGHT / 2`
XCUT=`expr $WIDTH / 2`
GEOX1=`expr $XCUT - $XCTR`
GEOY1=`expr $YCUT - $YCTR`
GEOX=`echo $GEOX1 | sed 's/-//'`
GEOY=`echo $GEOY1 | sed 's/-//'`
#
# -- Define Messages ---
#Message to be displayed on first line of the greeter
MESSAGE1="Welcome to the Sun Ray Cafe"
#Message to be displayed on second line of greeter
MESSAGE2="Please select an application"
MSG=`printf "%s\\n\\n" "$MESSAGE1" "$MESSAGE2"`
#-- Applications to run when buttons pushed --
APP2RUN1="/opt/SUNWutWBT/WBTStart.rdesktop"
APP2RUN2="/opt/firefox/firefox"


Dowload the sample scripts here. As always, have fun with it.

Comments:

I've been using this to offer a "dual-boot" option in my open SunRay lab. Users can select between a Windows desktop (using uttsc over RDP) or a Linux desktop (using Xnest over XDMCP). I made a small modification to the utsplash script and added an "exit 0" line after each $APP2RUN line within the while loop. This way, after the remote session is done, the local session restarts, leaving a clean environment for the next user. Thanks for the great tool!

Posted by Seth Galitzer on February 02, 2009 at 03:33 AM PST #

Hi,

What do I need to modify if I want o add another button. For example:

Button 1: Win XP
Button 2: Linux
Button 3: Win 2003
Button 4: Exit

Any Ideas?

Regards,

Randy

Posted by Randy Cruz on May 30, 2010 at 06:42 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

Think Thin is a collection of bloggers that work with Oracle's Virtual Desktop portfolio of products.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today