pandora-scripts: try to fix currentuser/home mess
[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
4 . /usr/pandora/scripts/op_common.sh
5 user_home=$(get_user_home)
6
7 case "$(cat $user_home/.lidconfig)" in
8         "lowpower")
9                 current="the Pandora goes into low power mode"
10         ;;
11         "shutdown")
12                 current="the Pandora is shut down"      
13         ;;
14         *)
15                 current="the screen is turned off"
16         ;;
17 esac
18
19 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
20 power button for less than 3 seconds)" "shutdown" "Shut the pandora down.") || exit
21 echo "$sel" > $user_home/.lidconfig