omap3-pandora-kernel2: update
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_switchgui.sh
1 #!/bin/bash
2
3 selection=$(cat /etc/pandora/conf/gui.conf | grep -v NOSWITCH | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Switch to a different GUI" --list --column "name" --column "description" --text "Select a GUI you want to switch to" )
4 echo $selection
5
6 if [ $selection ]; then
7
8   gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
9   stopnew=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $4}')
10
11   echo $gui
12
13   if [ $gui ]; then 
14     echo "$gui" > /tmp/gui.load
15     echo "$stopnew" > /tmp/gui.stopnew
16     echo $selection will be started
17     /tmp/gui.stop
18   else
19     exit 0
20   fi
21 else
22   echo "Nothing selected."
23   exit 0
24 fi