op_defaultgui.sh: Changed so it uses a config file for the GUI.
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_defaultgui.sh
1 #!/bin/bash
2
3 selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity ---width=500 --height=300 --title="Change he Default GUI" --list --multiple --column "Name" --column "Description" --text "Please select the GUI you want to run as default startup" )
4 echo $selection
5
6 gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
7
8 echo $gui
9
10 if [ $gui ]; then 
11   sed -i "s/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=$gui/g" ~/.xinitrc
12   echo $selection selected as default interface
13   zenity --info --title="Changed session" --text "Thank you, the default session has been changed to $selection." --timeout 6
14 else
15   exit 0
16 fi