From 91b1b5e037b761453d55de0383e90efbe6e1505f Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Fri, 20 May 2022 09:21:20 +0100 Subject: [PATCH] Add popup command parameter to the system module --- bumblebee_status/modules/contrib/system.py | 5 +++++ docs/modules.rst | 1 + 2 files changed, 6 insertions(+) diff --git a/bumblebee_status/modules/contrib/system.py b/bumblebee_status/modules/contrib/system.py index 00e80e0..79e8846 100644 --- a/bumblebee_status/modules/contrib/system.py +++ b/bumblebee_status/modules/contrib/system.py @@ -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") diff --git a/docs/modules.rst b/docs/modules.rst index 24046a0..69e56fd 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -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)