From: Grazvydas Ignotas Date: Sat, 22 Mar 2014 16:57:02 +0000 (+0200) Subject: pandora-scripts: username handling fixes from russ X-Git-Tag: sz_161~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c1f6edfbcafd8e57b8c0abdb2c73295fb2b8e43;p=openpandora.oe.git pandora-scripts: username handling fixes from russ 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 --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index e0cc35f..f36fce7 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "bash sed gawk grep zenity" -PR = "r156" +PR = "r157" SRC_URI = " \ file://op_paths.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_lidsettings.sh b/recipes/pandora-system/pandora-scripts/op_lidsettings.sh index aa0cc01..995d4ec 100644 --- a/recipes/pandora-system/pandora-scripts/op_lidsettings.sh +++ b/recipes/pandora-system/pandora-scripts/op_lidsettings.sh @@ -1,6 +1,6 @@ #!/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" ;; @@ -14,4 +14,4 @@ esac 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 diff --git a/recipes/pandora-system/pandora-scripts/op_power.sh b/recipes/pandora-system/pandora-scripts/op_power.sh index 461ecb3..bba0f51 100644 --- a/recipes/pandora-system/pandora-scripts/op_power.sh +++ b/recipes/pandora-system/pandora-scripts/op_power.sh @@ -12,9 +12,9 @@ debug(){ 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)"