From: Michael Mrozek Date: Tue, 6 Apr 2010 22:28:39 +0000 (+0200) Subject: op_defaultgui.sh: Changed so it uses a config file for the GUI. X-Git-Tag: Release-2010-05/1~86 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=e52c2fb676b40af0da0ea56ff8e900783184a9d1;hp=2118d8379a1fd258f923ef79081bac15f9915ef7 op_defaultgui.sh: Changed so it uses a config file for the GUI. --- diff --git a/recipes/pandora-system/pandora-scripts/op_defaultgui.sh b/recipes/pandora-system/pandora-scripts/op_defaultgui.sh old mode 100644 new mode 100755 index 7407acb..3eaa905 --- a/recipes/pandora-system/pandora-scripts/op_defaultgui.sh +++ b/recipes/pandora-system/pandora-scripts/op_defaultgui.sh @@ -1,41 +1,16 @@ -#!/bin/sh +#!/bin/bash -# Set the correct user for Autologin and enable / disable it. +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" ) +echo $selection -if zenity --question --title="Autologin" --text="Do you wish to automatically login at startup?\n\nSecurity warning: This skips the password check on startup" --ok-label="Yes" --cancel-label="No"; then - # echo "PREFERED_USER=$username" > /etc/default/autologin - sed -i "s/.*default_user.*/default_user $username/g" /etc/slim.conf - sed -i 's/.*auto_login.*/auto_login yes/g' /etc/slim.conf -else - if zenity --question --title="User" --text="Do you wish to have your username automatically populated in the login screen?\n\nNote: This is ideal if your the only user of the OpenPandora but wish to disable autologin and use a password." --ok-label="Yes" --cancel-label="No"; then - sed -i "s/.*default_user.*/default_user $username/g" /etc/slim.conf - sed -i 's/.*auto_login.*/auto_login no/g' /etc/slim.conf - else - sed -i "s/.*default_user.*/default_user/g" /etc/slim.conf - sed -i 's/.*auto_login.*/auto_login no/g' /etc/slim.conf - fi -fi - -# ---- - -# Select the default interface and setup SLiM to pass that as a sesion to ~./.xinitrc +gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}') -while ! launcher=$(zenity --height 260 --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)" "mmenu" "A very basic GUI (MiniMenu)" "pmenu" "Gaming-console like launcher (PMenu)" "netbooklauncher" "Ubuntu Netbook Launcher") || [ "x$launcher" = "x" ]; do - zenity --title="Error" --error --text="Please select a default launcher." --timeout 6 -done +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' ~/.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' ~/.xinitrc - echo PMenu selected as default interface -elif [ $launcher == "netbooklauncher" ]; then - sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startnetbooklauncher/g' ~/.xinitrc -elif [ $launcher == "mmenu" ]; then - sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startmmenu/g' ~/.xinitrc -fi - -zenity --info --title="Changed session" --text "Thankyou, the default session has been changed." --timeout 6 +if [ $gui ]; then + sed -i "s/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=$gui/g" ~/.xinitrc + echo $selection selected as default interface + zenity --info --title="Changed session" --text "Thank you, the default session has been changed to $selection." --timeout 6 +else + exit 0 +fi \ No newline at end of file