[olpc-help] bash script for window manager selection
    Ace_NoOne 
    community-support at lists.laptop.org
       
    Thu Jan 24 03:02:37 EST 2008
    
    
  
Hello,
After installing Xfce (http://wiki.laptop.org/go/Xfce) as alternative window manager, I now want to be prompted whether to launch Sugar or Xfce on startup.
My understanding (as a Linux newbie) is that I could add a bash script to .xsession. Here's what I have so far:
Code:
PS3 = "Choose window manager: "
OPTIONS = "Sugar Xfce"
select i in $OPTIONS; do
  if [ "$i" = "Sugar" ]; then
    echo "starting Sugar"
    sugar
    exit
  elif [ "$i" = "Xfce" ]; then
    echo "launching Xfce"
    startxfce4
    exit
  fi
done
There are a few things I want to improve:	Currently the user has to confirm his selection using the Enter key - is there a way to use single-key selection instead, without Enter?
	It would be nice to have a 5-second timer; if no selection is made during that time, a default option is selected automatically.
	I understand that processing is strictly sequential - that is, if I start a program, the next line won't be executed until said program has been terminated. Does this mean that the selection script would be active in the background at all times?
Any help would be greatly appreciated!
    
    
More information about the community-support
mailing list