From 517dae68f8bdd69a87cb184fed74fab7cdc301b022d07189dd8150f8555cc343 Mon Sep 17 00:00:00 2001 From: Togan Muftuoglu Date: Thu, 15 May 2014 10:31:13 +0000 Subject: [PATCH] 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 --- awesome-branding-openSUSE-systemctl.patch | 31 +++++++++++++++++++++++ awesome-branding-openSUSE.changes | 6 +++++ awesome-branding-openSUSE.spec | 5 +++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 awesome-branding-openSUSE-systemctl.patch diff --git a/awesome-branding-openSUSE-systemctl.patch b/awesome-branding-openSUSE-systemctl.patch new file mode 100644 index 0000000..b5bd6b4 --- /dev/null +++ b/awesome-branding-openSUSE-systemctl.patch @@ -0,0 +1,31 @@ +From 7af68ceb7be0a0d5881f1119dcfdc5cc338ddea6 Mon Sep 17 00:00:00 2001 +From: Gary Ching-Pang Lin +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 +--- + 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 + diff --git a/awesome-branding-openSUSE.changes b/awesome-branding-openSUSE.changes index a2cdb38..78f810f 100644 --- a/awesome-branding-openSUSE.changes +++ b/awesome-branding-openSUSE.changes @@ -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 diff --git a/awesome-branding-openSUSE.spec b/awesome-branding-openSUSE.spec index 2c2ee59..5b95336 100644 --- a/awesome-branding-openSUSE.spec +++ b/awesome-branding-openSUSE.spec @@ -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 # # 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