Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 558294
Collapse All | Expand All

(-)a/samples/powerbtn/powerbtn.sh (-3 / +3 lines)
Lines 13-19 Link Here
13
#   XUSER - the name of the user
13
#   XUSER - the name of the user
14
#   XAUTHORITY - full pathname of the user's .Xauthority file
14
#   XAUTHORITY - full pathname of the user's .Xauthority file
15
getXuser() {
15
getXuser() {
16
        user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
16
        user=`pinky -fw | awk '{ if ($2 == "?:'$displaynum'" || $(NF) == "?:'$displaynum'" ) { print $1; exit; } }'`
17
        if [ x"$user" = x"" ]; then
17
        if [ x"$user" = x"" ]; then
18
                startx=`pgrep -n startx`
18
                startx=`pgrep -n startx`
19
                if [ x"$startx" != x"" ]; then
19
                if [ x"$startx" != x"" ]; then
Lines 51-63 Link Here
51
getXconsole
51
getXconsole
52
52
53
# A list of power management system process names.
53
# A list of power management system process names.
54
PMS="gnome-power-manager kpowersave xfce4-power-manager"
54
PMS="gnome-power-manager kpowersave xfce4-power-manager mate-power-manager"
55
PMS="$PMS guidance-power-manager.py dalston-power-applet"
55
PMS="$PMS guidance-power-manager.py dalston-power-applet"
56
56
57
# If one of those is running or any of several others,
57
# If one of those is running or any of several others,
58
if pidof x $PMS > /dev/null ||
58
if pidof x $PMS > /dev/null ||
59
	( test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon) ||
59
	( test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon) ||
60
	( test "$XUSER" != "" && test -x /usr/bin/qdbus && test -r /proc/$(pidof kded4)/environ && su - $XUSER -c "eval $(echo -n 'export '; cat /proc/$(pidof kded4)/environ |tr '\0' '\n'|grep DBUS_SESSION_BUS_ADDRESS); qdbus org.kde.kded" | grep -q powerdevil) ; then
60
	( test "$XUSER" != "" && test -x /usr/bin/qdbus && test -r /proc/$(pgrep -n kded4)/environ && su - $XUSER -c "eval $(echo -n 'export '; cat /proc/$(pgrep -n kded4)/environ |tr '\0' '\n'|grep DBUS_SESSION_BUS_ADDRESS); qdbus org.kde.kded" | grep -q powerdevil) ; then
61
	# Get out as the power manager that is running will take care of things.
61
	# Get out as the power manager that is running will take care of things.
62
    exit
62
    exit
63
fi
63
fi

Return to bug 558294