diff --git a/acpid.power.sh b/acpid.power.sh index dfd2a6d..a8e0b18 100644 --- a/acpid.power.sh +++ b/acpid.power.sh @@ -2,7 +2,16 @@ PATH=/sbin:/bin:/usr/bin -# Get the ID of the first active X11 session: +# Check session status using systemd +session_ids=$(systemd-loginctl list-sessions 2>/dev/null | awk '{print $1}') +for session in ${session_ids} ; do + session_status=$(systemd-loginctl session-status ${session}) + if [ -n "$(echo "${session_status}" | grep "Active: yes" 2> /dev/null)" ]; then + echo "${session_status}" | grep -e '\(gnome-settings-daemon\|kded4\|xfce4-power-manager\)' >& /dev/null && exit 0 + fi +done + +# Get the ID of the first active X11 session: using ConsoleKit uid_session=$( ck-list-sessions | \ awk ' diff --git a/acpid.spec b/acpid.spec index f74f774..8c68472 100644 --- a/acpid.spec +++ b/acpid.spec @@ -1,7 +1,7 @@ Summary: ACPI Event Daemon Name: acpid Version: 2.0.16 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Daemons Source: http://tedfelix.com/linux/acpid-%{version}.tar.xz @@ -129,6 +129,10 @@ fi %changelog +* Thu Jun 14 2012 Jaroslav Škarvada - 2.0.16-2 +- Added support for systemd-loginctl list-sessions + Resolves: rhbz#819559 + * Thu Mar 29 2012 Jaroslav Škarvada - 2.0.16-1 - New version