Accepting request 234148 from home:gary_lin:branches:X11:windowmanagers

use systemctl to shutdown and reboot

OBS-URL: https://build.opensuse.org/request/show/234148
OBS-URL: https://build.opensuse.org/package/show/X11:windowmanagers/awesome-branding-openSUSE?expand=0&rev=7
This commit is contained in:
Togan Muftuoglu 2014-05-15 10:31:13 +00:00 committed by Git OBS Bridge
parent 1c31f35801
commit 517dae68f8
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 7af68ceb7be0a0d5881f1119dcfdc5cc338ddea6 Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <glin@suse.com>
Date: Thu, 15 May 2014 16:46:15 +0800
Subject: [PATCH] Use systemctl to shutdown and reboot
By default, systemd allows the local user to shutdown and reboot the
system, so we can use systemctl to do that without typing the password.
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
---
rc.lua | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rc.lua b/rc.lua
index dc12186..c277fc8 100644
--- a/rc.lua
+++ b/rc.lua
@@ -129,8 +129,8 @@ end
mysystem_menu = {
{ 'Lock Screen', 'xscreensaver-command -lock', freedesktop.utils.lookup_icon({ icon = 'system-lock-screen' }) },
{ 'Logout', awesome.quit, freedesktop.utils.lookup_icon({ icon = 'system-log-out' }) },
- { 'Reboot System', 'xdg-su -c "shutdown -r now"', freedesktop.utils.lookup_icon({ icon = 'reboot-notifier' }) },
- { 'Shutdown System', 'xdg-su -c "shutdown -h now"', freedesktop.utils.lookup_icon({ icon = 'system-shutdown' }) }
+ { 'Reboot System', 'systemctl reboot', freedesktop.utils.lookup_icon({ icon = 'reboot-notifier' }) },
+ { 'Shutdown System', 'systemctl poweroff', freedesktop.utils.lookup_icon({ icon = 'system-shutdown' }) }
}
myawesome_menu = {
--
1.8.4.5

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 15 05:56:09 UTC 2014 - glin@suse.com
- Add awesome-branding-openSUSE-systemctl.patch to use systemctl
to shutdown and reboot
-------------------------------------------------------------------
Sun Jul 7 11:55:03 UTC 2013 - toganm@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package awesome-branding-openSUSE
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Togan Muftuoglu <toganm@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
@ -32,6 +32,8 @@ Conflicts: otherproviders(%main_pack-branding)
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %name-%git_version.tar.xz
# PATCH-FIX-UPSTREAM awesome-branding-openSUSE-systemctl.patch glin@suse.com -- Use systemctl to allow the local user to reboot and shutdown the system without typing the password
Patch0: awesome-branding-openSUSE-systemctl.patch
Requires: awesome-freedesktop
Requires: awesome-vicious
Requires: gnome-icon-theme
@ -47,6 +49,7 @@ look and feel for awesome window manager.
%prep
%setup -q -n %name-%git_version
%patch0 -p1
%build