summaryrefslogtreecommitdiff
path: root/kanotix-power-button
diff options
context:
space:
mode:
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