Add popup command parameter to the system module

This commit is contained in:
Sam Tebbs 2022-05-20 09:21:20 +01:00
parent 2e8495d5ff
commit 91b1b5e037
2 changed files with 6 additions and 0 deletions

View file

@ -72,6 +72,11 @@ class Module(core.module.Module):
util.cli.execute(command)
def popup(self, widget):
popupcmd = self.parameter("popupcmd", "");
if (popupcmd != ""):
util.cli.execute(popupcmd)
return
menu = util.popup.menu()
reboot_cmd = self.parameter("reboot", "reboot")
shutdown_cmd = self.parameter("shutdown", "shutdown -h now")

View file

@ -1413,6 +1413,7 @@ Parameters:
* system.lock: specify a command for locking the screen (defaults to 'i3exit lock')
* system.suspend: specify a command for suspending (defaults to 'i3exit suspend')
* system.hibernate: specify a command for hibernating (defaults to 'i3exit hibernate')
* system.popupcmd: specify a command to run instead of opening the default menu
Requirements:
tkinter (python3-tk package on debian based systems either you can install it as python package)