SHA256
1
0
forked from pool/acpid

Accepting request 187004 from Base:System

- power_button: iterate systemd-logind sessions and do nothing if a
  active X session found (bnc#810125) (forwarded request 186826 from michael-chang)

OBS-URL: https://build.opensuse.org/request/show/187004
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/acpid?expand=0&rev=64
This commit is contained in:
Tomáš Chvátal 2013-08-18 20:43:32 +00:00 committed by Git OBS Bridge
commit dcdd92e571
2 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Aug 13 06:44:10 UTC 2013 - mchang@suse.com
- power_button: iterate systemd-logind sessions and do nothing if a
active X session found (bnc#810125)
-------------------------------------------------------------------
Fri Aug 2 11:56:14 UTC 2013 - werner@suse.de

View File

@ -54,5 +54,28 @@ while read A; do
fi
done < <(ck-list-sessions)
# iterate over all sessions. If a active X session is found, do nothing
# bnc#810125 - 12.3 power button always halts system instead suspend
# similar to consolekit checks, this time we check systemd-logind sessions
while read SESSION DUMMY ; do
# check if this is a X session, if not, go on
DISP=`loginctl --property=Display show-session $SESSION`
DISP=`echo $DISP | sed -e 's/^Display=//'`
[ -n "$DISP" ] || continue
STATE=`loginctl --property=State show-session $SESSION`
STATE=`echo $STATE | sed -e 's/^State=//'`
if [ "$STATE" = "active" -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`" -o -n "`pidof dalston-power-applet`" -o -n "`pidof gnome-settings-daemon`" ]; then
echo doing nothing...
exit 0
fi
fi
done < <(loginctl list-sessions)
logger -s -t pm-profiler "Power Button pressed, executing $EXEC"
$EXEC