Wednesday Nov 05, 2008

My Sun Ray TM session can now automatically switch desktop size when moving between different clients.

For example:

Having logged on originally at my desk, Sun Ray 2FS with a 1920x1200 monitor

I pull my card and move to a break area with a Sun Ray 150 with a much smaller screen

The whole desktop is displayed, no panning required :-D

Sun Ray Server Software 4.1 includes a new standalone Xserver, Xnewt, based on Xorg 7.2 community source. Xnewt introduces the XRandR extension to Sun Ray which amongst other features enables the session to switch Video Resolution and resize the desktop dynamically. No more panning around when using on a smaller display, or unused space when moving to a larger display.

Using the example above, moving from the Sun Ray 2FS with a 1920x1200 monitor to a Sun Ray 150 xrandr reports:

$ /usr/X11/bin/xrandr -q
 SZ:    Pixels          Physical       Refresh
 0    640 x 480    ( 180mm x 135mm )
 1    800 x 600    ( 225mm x 169mm )
 2   1024 x 768    ( 289mm x 216mm )
 3   1152 x 900    ( 325mm x 254mm )
 4   1280 x 1024   ( 361mm x 289mm )
 5   1400 x 1050   ( 395mm x 296mm )
 6   1440 x 900    ( 406mm x 254mm )
 7   1600 x 1024   ( 451mm x 289mm )
 8   1600 x 1200   ( 451mm x 339mm )
 9   1680 x 1050   ( 474mm x 296mm )
 10  1920 x 1080   ( 542mm x 305mm )
*11  1920 x 1200   ( 542mm x 339mm )
Current rotation - normal
Current reflection - none
Rotations possible - normal 
Reflections possible - none

While by comparison the Sun Ray setting, as reported by utset is somewhat smaller:

$ /opt/SUNWut/bin/utset | grep '^Display Timing 1:'
Display Timing 1: 1024x768@60
$

Therefore I can dynamically change the desktop using xrandr command and shrink my desktop accordingly:

$ /usr/X11/bin/xrandr -s 1024x768

The one caveat at this time is that for xrandr to grow the desktop Xorg must have allocated sufficient memory for it. Obviously with the example above it would have done. But had I logged in on the Sun Ray 150 first there may have been a problem. Therefore you may need to set your preferred default resolution to the largest available value to allow for that growth. This is accomplished using utxconfig:

$ /opt/SUNWut/bin/utxconfig -r 1920x1200

So what of automatic switching?

Taking Chris' Sun Ray location idea a little further I re-wrote his script, ut-where, so that it automatically switches the display depending on the device setting. This modified script has a couple of other new features including

  • Pops up a window asking for the location if it's not known using zenity(1) (times out after 5 mins if you don't answer).
  • Sets your status as un-available if the location description includes the word "conference".
  • May be used to start IM client and monitor clients using the -i option.
  • As before sets your away status when you disconnect (remove your card), unless that is you have already set your status to away... Great when you want to set your away status to something descriptive before leaving.

I'm still toying with the idea of saving other preferences to the location file such as the preferred resolution and or pidgin status... Full options listed below.

$ ut-where -h
usage: ut-where [-vxX][[-i]|[-d]|[-s]|[-t]|[-l]|[-c]|[-a [description]]]

  -a	Add location, prompts for description if none supplied.
    	Colon characters in description are substituted by space character.
  -l	Display contents of location file.
  -i	Initialise; starts utaction monitors for connect/disconnect
    	Will also start IM client if none active for user.
    	Kills current "utaction ut-where" scripts
  -c	Update pidgin with current description:
    	This option is intended to be used by "utaction -c"
    	If description is unknown then a description dialogue is
    	requested using zenity.
    	If description contains "conference" then status is
    	set to "unavailable".
  -d	Update IM tool with away message (unless away status already set).
    	This option is intended to be used by "utaction -d"
  -t	Display current description.
  -v	Verbose mode
  -x	Debug
  -X	Debug functions

Without any options the appliance name and description are displayed.
$

Thus to start IM client and utaction monitors simply use ut-which -i.

One final note. I have found some devices have there default resolution set much lower than expected, i.e. 640x480. Therefore you may need to change those. The best way to do that is to use utsettings (press <shift>-<props> keys together) and change the resolution under the "Display" category.

Happy switching.

Monday Jan 29, 2007

Just a quick note. One other modification that I made to my xorg.conf file, which has possibly saved my marriage, was to have Xorg use the audio device for the default beep, nee bell. This is accomplished by simply adding the following to the InputDevice section:

   Option "BellDevice" "/dev/audio"

Thanks goes to "Ramblings" and to Alan Coopersmith for this handy tip.

This blog copyright 2009 by ace