summaryrefslogtreecommitdiff
path: root/kanotix-power-button
diff options
context:
space:
mode:
authorHolger Paradies <retabell@gmx.de>2013-12-13 22:40:21 +0100
committerHolger Paradies <retabell@gmx.de>2013-12-13 23:06:26 +0100
commitaeee37aa2f588dfe225b743aeecb4669d20d5c25 (patch)
tree5821751c6fc7189b3d2dc2ffd5d2e6a6ac6c7972 /kanotix-power-button
parent3e9c669db819c43905b3bd1135c2926cc812d1de (diff)
downloadkanotix-packages-aeee37aa2f588dfe225b743aeecb4669d20d5c25.zip
kanotix-packages-aeee37aa2f588dfe225b743aeecb4669d20d5c25.tar.gz
user-fix
Diffstat (limited to 'kanotix-power-button')
-rw-r--r--kanotix-power-button/debian/changelog6
-rwxr-xr-xkanotix-power-button/powerbtn-kanotix.sh6
2 files changed, 9 insertions, 3 deletions
diff --git a/kanotix-power-button/debian/changelog b/kanotix-power-button/debian/changelog
index 233f5a7..be84999 100644
--- a/kanotix-power-button/debian/changelog
+++ b/kanotix-power-button/debian/changelog
@@ -1,3 +1,9 @@
+kanotix-power-button (0.2) unstable; urgency=low
+
+ * fix user-detection
+
+ -- Holger Paradies <retabell@gmx.de> Fri, 13 Dec 2013 19:16:44 +0100
+
kanotix-power-button (0.1) unstable; urgency=low
* Initial Release.
diff --git a/kanotix-power-button/powerbtn-kanotix.sh b/kanotix-power-button/powerbtn-kanotix.sh
index ed096e6..b420400 100755
--- a/kanotix-power-button/powerbtn-kanotix.sh
+++ b/kanotix-power-button/powerbtn-kanotix.sh
@@ -14,16 +14,16 @@ pidof lxsession-logout > /dev/null && exit 3 # only start once
getuser ()
{
export DISPLAY=:0
- user=`who|awk '/'"$DISPLAY"/'{print $1}'|head -1`
+ user=`ps aux|awk '/\/usr\/bin\/lxsession/{print $1}'|head -1`
logger "Powerbtn: user $user pushed powerbutton"
export XAUTHORITY=/home/$user/.Xauthority
}
-getuser "$user"
+getuser
# only when option is set to ask
if grep -qs '<property name="power-button-action" type="uint" value="3"/>' /home/$user/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
then
export _LXSESSION_PID=`pidof lxsession`
logger "Powerbtn: user $user requested logout screen"
- su $user -c "/usr/bin/lxde-logout" &
+ /bin/su $user -c "/usr/bin/lxsession-logout --banner /usr/share/lxde/images/logout-banner.png --side=top" &
fi