Merge pull request #422 from adario7/master

Add log out, switch user, lock, suspend and hibernate options to module system
This commit is contained in:
tobi-wan-kenobi 2019-08-22 18:35:31 +02:00 committed by GitHub
commit c9fdbd6f39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -219,6 +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')
* i3exit (for module 'system')
# Examples
Here are some screenshots for all themes that currently exist:

View file

@ -70,6 +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?", "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)