From 5c116f84d15a41035d0c005fefc4ee5e7eb0333a5f4a6636bf0a58c7cb0c7c91 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Tue, 15 Jan 2013 15:44:26 +0000 Subject: [PATCH] Minimize difference between power_button and sleep_button script OBS-URL: https://build.opensuse.org/package/show/Base:System/acpid?expand=0&rev=57 --- sleep_button | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sleep_button b/sleep_button index 6528f5b..185bfe9 100644 --- a/sleep_button +++ b/sleep_button @@ -17,8 +17,8 @@ while read A; do SESSION=`echo $A | sed 's/\(Session[0-9]*\):/\1/g'` IS_X=`dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit \ - /org/freedesktop/ConsoleKit/$SESSION \ - org.freedesktop.ConsoleKit.Session.GetX11Display` + /org/freedesktop/ConsoleKit/$SESSION \ + org.freedesktop.ConsoleKit.Session.GetX11Display` # check if this is a X session, if not, go on DISP=`echo $IS_X | sed -e 's/^.* string "\(.*\)"/\1/'` @@ -30,13 +30,13 @@ while read A; do IS_ACTIVE=`echo $IS_ACTIVE | sed -e 's/^.* boolean \(.*\)$/\1/'` if [ "$IS_ACTIVE" = "true" -a -n "$DISP" ]; then - # additional check, if none of these two apps are running, go on - if [ -n "`pidof kpowersave`" -o -n "`pidof gnome-power-manager`" -o -n "`pidof kded4`" ]; then - echo doing nothing... - exit 0 - fi + # additional check, if none of these two apps are running, go on + if [ -n "`pidof kpowersave`" -o -n "`pidof gnome-power-manager`" -o -n "`pidof kded4`" -o -n "`pidof dalston-power-applet`" -o -n "`pidof gnome-settings-daemon`" ]; then + echo doing nothing... + exit 0 + fi fi -done < <(ck-list-sessions) +done < <(ck-list-sessions) logger -s "Sleep Button event received, running $EXEC." $EXEC