pandora-scripts: Add a few more scripts. Bluetooth one needs more work.
authorDavid-John Willis <John.Willis@Distant-earth.com>
Sat, 13 Feb 2010 22:00:47 +0000 (22:00 +0000)
committerDavid-John Willis <John.Willis@Distant-earth.com>
Sat, 13 Feb 2010 22:00:47 +0000 (22:00 +0000)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_bluetooth.sh
recipes/pandora-system/pandora-scripts/op_defaultgui.desktop [new file with mode: 0644]
recipes/pandora-system/pandora-scripts/op_defaultgui.sh [new file with mode: 0644]

index 673de3a..7d22bbd 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r2"
+PR = "r4"
 
 SRC_URI = " \
           file://op_bright.sh \
@@ -16,7 +16,9 @@ SRC_URI = " \
           file://op_wifi.sh \
           file://op_wifi.desktop \          
           file://op_bluetooth.sh \
-          file://op_bluetooth.desktop \          
+          file://op_bluetooth.desktop \
+          file://op_defaultgui.sh \
+          file://op_defaultgui.desktop \
 "
 
 do_install() {
index d66c245..506a842 100644 (file)
@@ -13,7 +13,7 @@ done
 INTERFACE=`hciconfig | grep "^hci" | cut -d ':' -f 1`
 pgrep bluetoothd
 if [ $? = 1 ]; then
-       notify-send "Bluetooth" "The bluetooth interface is being set up..." -i /usr/share/icons/hicolor/32x32/apps/st_bluetooth.png
+       notify-send "Bluetooth" "The bluetooth interface is being set up..." -i /usr/share/icons/hicolor/32x32/apps/blueman.png
        sudo /usr/sbin/hciconfig ${INTERFACE} down
        sudo /usr/sbin/hciconfig ${INTERFACE} up pscan
        sudo /usr/sbin/bluetoothd
diff --git a/recipes/pandora-system/pandora-scripts/op_defaultgui.desktop b/recipes/pandora-system/pandora-scripts/op_defaultgui.desktop
new file mode 100644 (file)
index 0000000..96141a4
--- /dev/null
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Select Default GUI
+Comment=Change the default OpenPandora GUI
+StartupNotify=false
+Exec=gksudo /usr/pandora/scripts/op_defaultgui.sh
+Icon=Terminal
+Terminal=false
+Type=Application
+Categories=System;
diff --git a/recipes/pandora-system/pandora-scripts/op_defaultgui.sh b/recipes/pandora-system/pandora-scripts/op_defaultgui.sh
new file mode 100644 (file)
index 0000000..5243b50
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Select the default interface.
+
+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 
+       zenity --title="Error" --error --text="Please select a default launcher." --timeout 6
+done
+
+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
+else
+#      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
+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
+
+# ----