DEPENDS = "zenity dbus"
RDEPENDS = "zenity dbus"
-PR = "r4"
+PR = "r5"
SRC_URI = " \
file://op_bright.sh \
file://op_bluetooth.desktop \
file://op_defaultgui.sh \
file://op_defaultgui.desktop \
+ file://op_switchgui.sh \
+ file://op_switchgui.desktop \
+ file://startnetbooklauncher \
"
do_install() {
install -m 0755 ${WORKDIR}/op_bright.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_cpuspeed.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_wifi.sh ${D}${prefix}/pandora/scripts/
- install -m 0755 ${WORKDIR}/op_bluetooth.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_bluetooth.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_defaultgui.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_switchgui.sh ${D}${prefix}/pandora/scripts/
+
install -d ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_bright.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_cpuspeed.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_wifi.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_bluetooth.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_defaultgui.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_switchgui.desktop ${D}${datadir}/applications/
+
+ install -d ${D}${bindir}/
+ install -m 0755 ${WORKDIR}/startnetbooklauncher ${D}${bindir}/
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
#!/bin/sh
-# Select the default interface.
+# Set the correct user for Autologin and enable / disable it.
+
+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
-while ! launcher=$(zenity --list --title="Default User Interface" --text="Please choose your default application launcher." --column "return" --print-column=1 --hide-column=1 --column "Pick a launcher" "xfce" "Desktop environment (Xfce)" "pmenu" "Gaming-console like launcher (PMenu)") || [ "x$launcher" = "x" ]; do
+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" "Ubuntu Netbook Launcher") || [ "x$launcher" = "x" ]; do
zenity --title="Error" --error --text="Please select a default launcher." --timeout 6
done
# 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
-else
+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
fi
-# Set the correct user for Autologin and enable / disable it.
-
-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
- sudo sed -i 's/.*auto_login.*/auto_login yes/g' /etc/slim.conf
-else
- sudo sed -i 's/.*auto_login.*/auto_login no/g' /etc/slim.conf
- fi
-fi
-
-# ----
+zenity --info --title="Changed session" --text "Thankyou, the default session has been changed." --timeout 6
--- /dev/null
+#!/bin/sh
+launcher=$(zenity --height 220 --list --title="Switch to a different GUI" --text="Please select the GUI you want to switch to.\nNote: All running applications will be terminated!" --column "return" --print-column=1 --hide-column=1 --column "Pick a launcher" "startxfce4" "Switch to Xfce" "pmenu" "Switch to PMenu" "startnetbooklauncher" "Switch to Netbook Launcher")
+
+if [ "$launcher" == "" ]; then
+ exit 0
+else
+ echo "$launcher" > /tmp/gui.load
+ if [ "$(pidof xfce4-session)" ]
+ then
+ xfce4-session-logout --logout
+ else
+ killall netbook-launcher-efl
+ fi
+fi