Fixed loginctl and added support for cinnamon and mate (patch by Leigh Scott)

Resolves: rhbz#1029868
This commit is contained in:
Jaroslav Škarvada 2013-11-13 16:34:59 +01:00
parent d0e3cdb821
commit 31682fe72c
2 changed files with 13 additions and 7 deletions

View File

@ -3,11 +3,11 @@
PATH=/sbin:/bin:/usr/bin
# Check session status using systemd
session_ids=$(systemd-loginctl list-sessions 2>/dev/null | awk '{print $1}')
session_ids=$(loginctl list-sessions 2>/dev/null | awk '{print $1}')
for session in ${session_ids} ; do
session_status=$(systemd-loginctl session-status ${session})
session_status=$(loginctl session-status ${session})
echo "${session_status}" | grep -e '\(Active: yes\|State: active\)' &> /dev/null &&
echo "${session_status}" | grep -e '\(gnome-settings-daemon\|kded4\|xfce4-power-manager\)' &> /dev/null && exit 0
echo "${session_status}" | grep -e '\(gnome-settings-daemon\|cinnamon-settings-daemon\|kded4\|xfce4-power-manager\|mate-power-manager\)' &> /dev/null && exit 0
done
# Get the ID of the first active X11 session: using ConsoleKit
@ -30,7 +30,9 @@ ps axo uid,cmd | \
awk '
$1 == '$uid_session' &&
($2 ~ /gnome-power-manager/ || $2 ~ /kpowersave/ ||
$2 ~ /xfce4-power-manager/ || $2 ~ /\/usr\/libexec\/gnome-settings-daemon/ ||
$2 ~ /mate-power-manager/ || $2 ~ /xfce4-power-manager/ ||
$2 ~ /\/usr\/libexec\/gnome-settings-daemon/ ||
$2 ~ /\/usr\/libexec\/cinnamon-settings-daemon/ ||
$2 ~ /kded4/ || $3 ~ /guidance-power-manager/) \
{ found = 1; exit }
END { exit !found }

View File

@ -8,7 +8,7 @@
Summary: ACPI Event Daemon
Name: acpid
Version: 2.0.20
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
Group: System Environment/Daemons
Source: http://downloads.sourceforge.net/acpid2/%{name}-%{version}.tar.xz
@ -125,6 +125,10 @@ fi
%changelog
* Wed Nov 13 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.20-2
- Fixed loginctl and added support for cinnamon and mate (patch by Leigh Scott)
Resolves: rhbz#1029868
* Mon Sep 16 2013 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.20-1
- New version
Resolves: rhbz#1008344