From 92e568c467f2aba87f5cb98429684a786ab7c50e Mon Sep 17 00:00:00 2001 From: adario Date: Tue, 20 Aug 2019 13:27:12 +0200 Subject: [PATCH] module system: use i3exit, add more options --- README.md | 2 +- bumblebee/modules/system.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6a1007f..636e733 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ Modules and commandline utilities are only required for modules, the core itself * sensors (for module 'sensors', as fallback) * zpool (for module 'zpool') * progress (for module 'progress') -* systemd (for module 'system') +* i3exit (for module 'system') # Examples Here are some screenshots for all themes that currently exist: diff --git a/bumblebee/modules/system.py b/bumblebee/modules/system.py index 9de42c6..48f48ec 100644 --- a/bumblebee/modules/system.py +++ b/bumblebee/modules/system.py @@ -70,10 +70,12 @@ class Module(bumblebee.engine.Module): menu = bumblebee.popup_v2.PopupMenu() menu.add_menuitem("shutdown", callback=functools.partial(self._on_command, "Shutdown", "Shutdown?", "shutdown -h now")) menu.add_menuitem("reboot", callback=functools.partial(self._on_command, "Reboot", "Reboot?", "reboot")) - menu.add_menuitem("log out", callback=functools.partial(self._on_command, "Log out", "Log out?", "bash -c 'loginctl terminate-session $(cat /proc/self/sessionid)'")) - # don't ask for confirmation when suspending or hibernating - menu.add_menuitem("suspend", callback=functools.partial(bumblebee.util.execute, "systemctl suspend")) - menu.add_menuitem("hibernate", callback=functools.partial(bumblebee.util.execute, "systemctl hibernate")) + menu.add_menuitem("log out", callback=functools.partial(self._on_command, "Log out", "Log out?", "i3exit logout")) + # don't ask for these + menu.add_menuitem("switch user", callback=functools.partial(bumblebee.util.execute, "i3exit switch_user")) + menu.add_menuitem("lock", callback=functools.partial(bumblebee.util.execute, "i3exit lock")) + menu.add_menuitem("suspend", callback=functools.partial(bumblebee.util.execute, "i3exit suspend")) + menu.add_menuitem("hibernate", callback=functools.partial(bumblebee.util.execute, "i3exit hibernate")) menu.show(widget)