Merge pull request #876 from SamTebbs33/main

Add popup command parameter to the system module
This commit is contained in:
tobi-wan-kenobi 2022-05-20 10:26:10 +02:00 committed by GitHub
commit 6b2b5217ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -72,6 +72,11 @@ class Module(core.module.Module):
util.cli.execute(command) util.cli.execute(command)
def popup(self, widget): def popup(self, widget):
popupcmd = self.parameter("popupcmd", "");
if (popupcmd != ""):
util.cli.execute(popupcmd)
return
menu = util.popup.menu() menu = util.popup.menu()
reboot_cmd = self.parameter("reboot", "reboot") reboot_cmd = self.parameter("reboot", "reboot")
shutdown_cmd = self.parameter("shutdown", "shutdown -h now") 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.lock: specify a command for locking the screen (defaults to 'i3exit lock')
* system.suspend: specify a command for suspending (defaults to 'i3exit suspend') * system.suspend: specify a command for suspending (defaults to 'i3exit suspend')
* system.hibernate: specify a command for hibernating (defaults to 'i3exit hibernate') * 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: Requirements:
tkinter (python3-tk package on debian based systems either you can install it as python package) tkinter (python3-tk package on debian based systems either you can install it as python package)