op_cpuspeed.sh: allow to disable 'stupid' quistions
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_lidsettings.sh
1 #!/bin/bash
2 # change what to do when the lid is closed/opened
3 case "$(cat $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.lidconfig)" in
4         "lowpower")
5                 current="the Pandora goes into low power mode"
6         ;;
7         "shutdown")
8                 current="the Pandora is shut down"      
9         ;;
10         *)
11                 current="the screen is turned off"
12         ;;
13 esac
14
15 sel=$(zenity --title="Lid settings" --height=250 --list --column "id" --column "Please select" --hide-column=1 --text="What should happen when you close the Pandora's lid?\n(the opposite of the selected action is performed when opening the lid again)\nAt the moment $current when you close the lid." "brightness" "Turn off the screen." "lowpower" "Go into low power mode (same as when pressing the
16 power button for less than 3 seconds)" "shutdown" "Shut the pandora down.") || exit
17 echo "$sel" > $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.lidconfig