pandora-first-run-wizard: Added reboot instead of set up now.
[openpandora.oe.git] / recipes / pandora-system / pandora-first-run-wizard / first-run-wizard.sh
old mode 100644 (file)
new mode 100755 (executable)
index 61f28a3..e7d6842
@@ -24,7 +24,7 @@ RESET_ROOT="yes"
 
 # Greet the user.
 
-zenity --info --title="Pandoras Box has been opened." --text="Welcome!\n\nPandora's Box has been opened.\n\nThis wizard will help you setting up your new OpenPandora handheld before the first use.\n\nYou will be asked a few simple questions to personalise and configure your device for use." --timeout 45
+if zenity --question --title="Pandoras Box has been opened." --text="Welcome!\n\nPandora's Box has been opened.\n\nThis wizard will help you setting up your new OpenPandora handheld before the first use.\n\nYou will be asked a few simple questions to personalise and configure your device for use.\n\nDo you want to setup your unit now or shutdown the unit and do it later?" --ok-label="Start now" --cancel-label="Shutdown" ; then
 
 # ----
 
@@ -147,20 +147,20 @@ fi
 
 # Select the default interface and setup SLiM to pass that as a sesion to ~./.xinitrc
 
-while ! launcher=$(zenity --height 250 --list --title="Default User Interface" --text="Please choose your default application launcher.\n\nYou can always change this setting later." --column "return" --print-column=1 --hide-column=1 --column "Pick a launcher" "xfce" "Desktop environment (Xfce)" "pmenu" "Gaming-console like launcher (PMenu)" "netbooklauncher" "Netbook Launcher") || [ "x$launcher" = "x" ]; do 
-       zenity --title="Error" --error --text="Please select a default launcher." --timeout 6
-done
+selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Select the Default GUI" --list --column "name" --column "description" --text "select defaultgui" )
+echo $selection
+
+gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
+stopcommand=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $4}')
+
+echo $gui
 
-if [ $launcher == "xfce" ]; then 
-#      sed -i 's/.*sessions .*/sessions xfce4,pmenu/g' /etc/slim.conf
-       sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startxfce4/g' /home/$username/.xinitrc
-       echo Xfce selected as default interface
-elif [ $launcher == "pmenu" ]; then
-#      sed -i 's/.*sessions .*/sessions pmenu,xfce4/g' /etc/slim.conf
-       sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=pmenu/g' /home/$username/.xinitrc
-       echo PMenu selected as default interface
-elif [ $launcher == "netbooklauncher" ]; then
-       sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startnetbooklauncher/g' /home/$username/.xinitrc
+if [ $gui ]; then 
+  sed -i "s/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=$gui/g" /home/$username/.xinitrc
+  echo $selection selected as default interface
+  zenity --info --title="Selected session" --text "You selected $selection as default setting. You can always change your default GUI later." --timeout 6
+else
+  sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startxfce4/g' /home/$username/.xinitrc
 fi
 
 # ----
@@ -215,3 +215,6 @@ touch /etc/pandora/first-boot
 chmod 0666 /etc/pandora/first-boot
 
 # ----
+else
+poweroff
+fi
\ No newline at end of file