DEPENDS = "zenity dbus"
RDEPENDS = "zenity dbus"
-PR = "r5"
+PR = "r9"
SRC_URI = " \
file://op_bright.sh \
file://op_wifi.sh \
file://op_wifi.desktop \
file://op_bluetooth.sh \
- file://op_bluetooth.desktop \
+ file://op_bluetooth-check.desktop \
+ file://op_bluetooth.desktop \
file://op_defaultgui.sh \
file://op_defaultgui.desktop \
file://op_switchgui.sh \
install -m 0644 ${WORKDIR}/op_defaultgui.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_switchgui.desktop ${D}${datadir}/applications/
+ install -d ${D}${sysconfdir}/xdg/autostart/
+ install -m 0644 ${WORKDIR}/op_bluetooth-check.desktop ${D}${sysconfdir}/xdg/autostart/op_bluetooth-check.desktop
+
install -d ${D}${bindir}/
install -m 0755 ${WORKDIR}/startnetbooklauncher ${D}${bindir}/
}
--- /dev/null
+[Desktop Entry]
+Name=Check Bluetooth Status
+Comment=Check the status of your Bluetooth device and enable if desired.
+StartupNotify=false
+Exec=/usr/pandora/scripts/op_bluetooth.sh startup
+Icon=bluetooth
+Terminal=false
+Type=Application
+Categories=System;
[Desktop Entry]
-Name=Toggle Bluetooth
+Name=Toggle Bluetooth Status
Comment=Toggle the status of your Bluetooth device.
StartupNotify=false
Exec=/usr/pandora/scripts/op_bluetooth.sh
-Icon=Terminal
+Icon=bluetooth
Terminal=false
Type=Application
Categories=System;
#
# Released under the GPL
-SILENT=0
-while getopts s opt
-do
- case "$opt" in
- s) SILENT=1;;
- esac
-done
+STARTUP=0
-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/blueman.png
- sudo /usr/sbin/hciconfig ${INTERFACE} down
- sudo /usr/sbin/hciconfig ${INTERFACE} up pscan
- sudo /usr/sbin/bluetoothd
+if [ ${1} = startup ]; then
+ STARTUP=1
fi
-if [ ${SILENT} = 0 ]; then
- bluetooth-wizard
+INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`"
+
+if [ ${STARTUP} = 1 ]; then
+ [ -f ~/.op_btenabled ] && sudo /usr/sbin/hciconfig ${INTERFACE} up pscan && sudo /usr/sbin/bluetoothd ||echo "Bluetooth: User has not enabled Bluetooth."
+else
+
+ # Figure out if Bluetooth is running or not
+
+ if [ "`hciconfig ${INTERFACE} | grep UP`" ]
+ then
+ notify-send -u normal "Bluetooth" "Bluetooth is being disabled..." -i /usr/share/icons/hicolor/32x32/apps/bluetooth.png
+ sudo /usr/sbin/hciconfig ${INTERFACE} down
+ rm ~/.op_btenabled
+ else
+ pgrep bluetoothd
+ if [ $? -ne 1 ]; then
+ notify-send -u normal "Bluetooth" "Bluetooth is being enabled..." -i /usr/share/icons/hicolor/32x32/apps/bluetooth.png
+ sudo /usr/sbin/hciconfig ${INTERFACE} down
+ sudo /usr/sbin/hciconfig ${INTERFACE} up pscan
+ sudo /usr/sbin/bluetoothd
+ rm ~/.op_btenabled
+ echo true > ~/.op_btenabled
+ fi
+ fi
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" "Ubuntu Netbook Launcher") || [ "x$launcher" = "x" ]; do
+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 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
#!/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")
+launcher=$(zenity --height 240 --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" "startmmenu" "Switch to MiniMenu" "pmenu" "Switch to PMenu" "startnetbooklauncher" "Switch to Netbook Launcher")
if [ "$launcher" == "" ]; then
exit 0