russ said:
"finding the user's home directory" really ought to be factored out to
somewhere generic (/usr/pandora/scripts/op_paths.sh perhaps, assuming
there's some reason this all doesn't just use $HOME), but if this OS
release series is moribund I'll just fix what's broken rather than
cleaning up the ugliness
RDEPENDS = "bash sed gawk grep zenity"
-PR = "r156"
+PR = "r157"
SRC_URI = " \
file://op_paths.sh \
#!/bin/bash
# change what to do when the lid is closed/opened
-case "$(cat $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.lidconfig)" in
+case "$(cat $(grep /etc/passwd -e ^$(ps u -C xfce4-session | tail -n1 | awk '{print $1}'): | cut -f 6 -d ":")/.lidconfig)" in
"lowpower")
current="the Pandora goes into low power mode"
;;
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
power button for less than 3 seconds)" "shutdown" "Shut the pandora down.") || exit
-echo "$sel" > $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.lidconfig
+echo "$sel" > $(grep /etc/passwd -e ^$(ps u -C xfce4-session | tail -n1 | awk '{print $1}'): | cut -f 6 -d ":")/.lidconfig
return 1 # 0 when debugging, 1 when not
}
-test -e $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.lidconfig && lidconfig=$(cat $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.lidconfig) # read lid conf. file if it exists
+test -e $(grep /etc/passwd -e ^$(ps u -C xfce4-session | tail -n1 | awk '{print $1}'): | cut -f 6 -d ":")/.lidconfig && lidconfig=$(cat $(grep /etc/passwd -e ^$(ps u -C xfce4-session | tail -n1 | awk '{print $1}'): | cut -f 6 -d ":")/.lidconfig) # read lid conf. file if it exists
-#powerbuttonconfig=$(cat $(grep /etc/passwd -e $(ps u -C xfce4-session | tail -n1 | awk '{print $1}')| cut -f 6 -d ":")/.powerbuttonconfig)
+#powerbuttonconfig=$(cat $(grep /etc/passwd -e ^$(ps u -C xfce4-session | tail -n1 | awk '{print $1}'): | cut -f 6 -d ":")/.powerbuttonconfig)
if [ -e /tmp/powerstate ]; then
powerstate="$(cat /tmp/powerstate)"