From aeee37aa2f588dfe225b743aeecb4669d20d5c25 Mon Sep 17 00:00:00 2001 From: Holger Paradies Date: Fri, 13 Dec 2013 22:40:21 +0100 Subject: user-fix --- kanotix-power-button/debian/changelog | 6 ++++++ kanotix-power-button/powerbtn-kanotix.sh | 6 +++--- 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 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 '' /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 -- cgit v1.0