COMPATIBLE_MACHINE = "omap3-pandora"
-PR = "r11"
+PR = "r12"
SRC_URI = " \
file://first-run-wizard.sh \
# Select the default interface and setup SLiM to pass that as a sesion to ~./.xinitrc
-selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Select the Default GUI" --list --multiple --column "name" --column "description" --text "select defaultgui" )
+selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Select the Default GUI" --list --column "name" --column "description" --text "select defaultgui" )
echo $selection
gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
--- /dev/null
+DESCRIPTION = "Save and restore the brightness and gamma state on shutdown / startup"
+LICENSE = "GPLv2"
+
+COMPATIBLE_MACHINE = "omap3-pandora"
+
+PR = "r0"
+inherit update-rc.d
+
+INITSCRIPT_NAME = "pandora-lcd-state"
+INITSCRIPT_PARAMS = "start 39 S . stop 31 0 1 6 ."
+
+SRC_URI = " \
+ file://rc.pandora-lcd-state \
+ file://gamma.state \
+ file://brightness.state \
+"
+
+do_install() {
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/rc.pandora-lcd-state ${D}${sysconfdir}/init.d/pandora-lcd-state
+ install -d ${D}${sysconfdir}/pandora/conf/
+ install -m 0644 ${WORKDIR}/gamma.state ${D}${sysconfdir}/pandora/conf/gamma.state
+ install -m 0644 ${WORKDIR}/brightness.state ${D}${sysconfdir}/pandora/conf/brightness.state
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} += "${prefix} ${datadir}"
--- /dev/null
+35
\ No newline at end of file
--- /dev/null
+105 315 381 431 490 537 579 686 780 837 880 1023
--- /dev/null
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: pandora-lcd-state
+# Required-Start: #adjust
+# Required-Stop: #adjust
+# Default-Start: S
+# Default-Stop: 0 1 6
+### END INIT INFO
+
+DESC="OpenPandora Save and Restore LCD Settings"
+NAME="pandora-lcd-state"
+
+d_stop() {
+ echo "Saving LCD-Settings"
+ cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness > /etc/pandora/conf/brightness.state
+ cat /sys/devices/platform/omap2_mcspi.1/spi1.1/gamma > /etc/pandora/conf/gamma.state
+}
+
+d_start() {
+ echo "Restoring LCD-Settings"
+ cat /etc/pandora/conf/brightness.state > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness
+ cat /etc/pandora/conf/gamma.state > /sys/devices/platform/omap2_mcspi.1/spi1.1/gamma
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: $NAME - "
+ d_start
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: $NAME - "
+ d_stop
+ echo "."
+ ;;
+ reload)
+ echo -n "Reloading $DESC: $NAME - "
+ d_start
+ echo "."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: $NAME - "
+ d_stop
+ sleep 1
+ d_start
+ echo "."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
DEPENDS = "zenity dbus"
RDEPENDS = "zenity dbus"
-PR = "r10"
+PR = "r12"
SRC_URI = " \
file://op_bright.sh \
file://op_calibrate.desktop \
file://op_datetime.sh \
file://op_datetime.desktop \
+ file://op_usermanager.sh \
+ file://op_usermanager.desktop \
file://gui.conf \
"
install -m 0755 ${WORKDIR}/op_switchgui.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_calibrate.sh ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_datetime.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_usermanager.sh ${D}${prefix}/pandora/scripts/
install -d ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_cpuspeed.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_switchgui.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_calibrate.desktop ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_datetime.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_usermanager.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
Comment=Set the brightness of the backlight.
StartupNotify=false
Exec=sudo /usr/pandora/scripts/op_bright.sh
-Icon=Terminal
+Icon=dialog-information
Terminal=false
Type=Application
Categories=System;
Comment=Calibrates the touchscreen. Restart afterwards
StartupNotify=false
Exec=/usr/pandora/scripts/op_calibrate.sh
-Icon=Terminal
+Icon=input-tablet
Terminal=false
Type=Application
Categories=System;
Comment=Under or overclock your OpenPandora CPU.
StartupNotify=false
Exec=sudo /usr/pandora/scripts/op_cpuspeed.sh
-Icon=Terminal
+Icon=xfce4-mixer
Terminal=false
Type=Application
Categories=System;
Comment=You can also select the timezone.
StartupNotify=false
Exec=sudo /usr/pandora/scripts/op_datetime.sh
-Icon=Terminal
+Icon=document-open-recent
Terminal=false
Type=Application
-Categories=System;
+Categories=Settings;
Comment=Change the default OpenPandora GUI.
StartupNotify=false
Exec=/usr/pandora/scripts/op_defaultgui.sh
-Icon=Terminal
+Icon=krfb
Terminal=false
Type=Application
-Categories=System;
+Categories=Settings;
#!/bin/bash
-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" )
+selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity ---width=500 --height=300 --title="Change he Default GUI" --list --column "Name" --column "Description" --text "Please select the GUI you want to run as default startup" )
echo $selection
gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
Comment=Switch to a different GUI.
StartupNotify=false
Exec=/usr/pandora/scripts/op_switchgui.sh
-Icon=Terminal
+Icon=krfb
Terminal=false
Type=Application
Categories=System;
#!/bin/bash
-selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Switch to a different GUI" --list --multiple --column "name" --column "description" --text "Select a GUI you want to switch to" )
+selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Switch to a different GUI" --list --column "name" --column "description" --text "Select a GUI you want to switch to" )
echo $selection
gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
--- /dev/null
+[Desktop Entry]
+Name=Usermanager
+Comment=A very simple usermanager
+StartupNotify=false
+Exec=gksudo /usr/pandora/scripts/op_usermanager.sh
+Icon=system-users
+Terminal=false
+Type=Application
+Categories=System;
--- /dev/null
+#!/bin/bash
+
+if zenity --question --title="Usermanager" --text="Do you wish to add or remove a user?" --ok-label="Add user" --cancel-label="Remove User"; then
+
+ echo "Add user"
+ while ! name=$(zenity --title="Enter full name" --entry --text "Please enter a full name for the new user.") || [ "x$name" = "x" ] ; do
+ zenity --title="Error" --error --text="Please try again." --timeout 6
+ done
+
+ username_guess=$(echo "$name" | cut -d" " -f1 | tr A-Z a-z)
+
+ while ! username=$(zenity --title="Enter the new username" --entry --text "Please choose a short username.\n\nIt should be all lowercase and contain only letters and numbers." --entry-text "$username_guess") || [ "x$username" = "x" ] ; do
+ zenity --title="Error" --error --text="Please try again." --timeout 6
+ done
+
+ while ! useradd -c "$name,,," -G adm,audio,video,wheel,netdev,plugdev,users "$username" ; do
+ username=$(zenity --title="Please check username" --entry --text "Please ensure that your username consists of only\nletters and numbers and is not already in use on the system." --entry-text "$username")
+ done
+
+ password=""
+ while [ x$password = x ] ; do
+ password1=$(zenity --title=Password --entry --text="Please choose a new password." --hide-text)
+ password2=$(zenity --title=Confirm --entry --text="Confirm your new password." --hide-text)
+ if [ $password1 != $password2 ] ; then
+ zenity --title="Error" --error --text="The passwords do not match.\n\nPlease try again." --timeout 6
+ else
+ if [ x$password1 = x ] ; then
+ zenity --title="Error" --error --text="Password cannot be blank!\n\nPlease try again." --timeout 6
+ else
+ password=$password1
+ fi
+ fi
+ done
+
+ passwd "$username" <<EOF
+ $password
+ $password
+EOF
+ if zenity --question --title="User created" --text="The user $username has been successfully created.\n\nDo you want to set this user as default user for the login?" --ok-label="Yes, please!" --cancel-label="No, keep the old user as default"; then
+ sed -i "s/.*default_user.*/default_user $username/g" /etc/slim.conf
+ fi
+ zenity --info --title="User created" --text "Thanks. The new user can now be used." --timeout 6
+else
+ xfceuser=$(ps u -C xfce4-session | tail -n1 | awk '{print $1}')
+ echo "Remove User"
+ amount=$(cat /etc/passwd | grep /home/ | grep -v root | awk -F\: '{print $1 }' | wc -l)
+ if [ ${amount} = "1" ]; then
+ zenity --title="Error" --error --text="Sorry! You can't remove the last normal user!" --timeout 6
+ else
+ selection=$(cat /etc/passwd | grep /home/ | grep -v root | grep -v $xfceuser | awk -F\: '{print $1 }' | zenity --width=100 --height=200 --title="Select the user to delete" --list --column "Username" --text "Select the user to delete\n\nPlease note: You can't remove the user that is currently logged in.")
+ if zenity --question --title="Confirm User Removal" --text="Are you REALLY sure you want to remove the user $selection?\n\nThere will be NO other confirmation and this can NOT be undone!" --ok-label="Yes, remove user!" --cancel-label="Don't remove the user"; then
+ echo "Really remove $selection"
+ userdel -fr $selection
+ sed -i "s/.*default_user $selection/default_user/g" /etc/slim.conf
+ zenity --info --title="User removed" --text "The user $selection has been removed." --timeout 6
+ else
+ echo "Don't remove $selection"
+ zenity --info --title="User not removed" --text "Cancelled removal of user $selection at user's request." --timeout 6
+ fi
+ fi
+fi
+
+
+
Comment=Toggle the status of the WiFi chip.
StartupNotify=false
Exec=sudo /usr/pandora/scripts/op_wifi.sh
-Icon=Terminal
+Icon=network-wireless
Terminal=false
Type=Application
Categories=System;
# /etc/skel is used by Shadow's useradd so you really have that installed for this to make sense ;)
RDEPENDS = "shadow"
-PR = "r1"
+PR = "r2"
SRC_URI = " \
file://.xinitrc \
RDEPENDS = "sudo"
-PR = "r0"
+PR = "r1"
SRC_URI = " \
file://50_openpandora \
PANDORA = " \
pandora-first-run-wizard hsetroot \
pandora-scripts \
+ pandora-lcd-state \
pandora-wallpaper-official pandora-wallpaper-community \
pandora-xfce-defaults \
pandora-xmms-defaults xmms \