From bdb44a9b0bac396c32f8404b914e6e6c1d66d8e4 Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sat, 13 Feb 2010 22:00:47 +0000 Subject: [PATCH] pandora-scripts: Add a few more scripts. Bluetooth one needs more work. --- recipes/pandora-system/pandora-scripts.bb | 6 ++-- .../pandora-scripts/op_bluetooth.sh | 2 +- .../pandora-scripts/op_defaultgui.desktop | 9 ++++++ .../pandora-scripts/op_defaultgui.sh | 29 +++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 recipes/pandora-system/pandora-scripts/op_defaultgui.desktop create mode 100644 recipes/pandora-system/pandora-scripts/op_defaultgui.sh diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 673de3a..7d22bbd 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -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() { diff --git a/recipes/pandora-system/pandora-scripts/op_bluetooth.sh b/recipes/pandora-system/pandora-scripts/op_bluetooth.sh index d66c245..506a842 100644 --- a/recipes/pandora-system/pandora-scripts/op_bluetooth.sh +++ b/recipes/pandora-system/pandora-scripts/op_bluetooth.sh @@ -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 index 0000000..96141a4 --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/op_defaultgui.desktop @@ -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 index 0000000..5243b50 --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/op_defaultgui.sh @@ -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 + +# ---- -- 2.39.2