From c514d965cb25314f57a3bca1c9643e86af00a214 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Fri, 9 Nov 2018 16:48:00 +0100 Subject: [PATCH] [modules/xrandr] Do not overwrite i3 config by default Require user to explicitly enable overwriting of i3 config files before starting to automatically assemble the i3 config from a template and a set of display-related config files. fixes #322 --- bumblebee/modules/xrandr.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/xrandr.py b/bumblebee/modules/xrandr.py index b01d6b6..f946936 100644 --- a/bumblebee/modules/xrandr.py +++ b/bumblebee/modules/xrandr.py @@ -2,6 +2,11 @@ """Shows a widget for each connected screen and allows the user to enable/disable screens. +Parameters: + * xrandr.overwrite_i3config: If set to 'true', this module assembles a new i3 config + every time a screen is enabled or disabled by taking the file "~/.config/i3/config.template" + and appending a file "~/.config/i3/config." for every screen. + Requires the following executable: * xrandr """ @@ -52,7 +57,11 @@ class Module(bumblebee.engine.Module): def _toggle(self, event): path = os.path.dirname(os.path.abspath(__file__)) - toggle_cmd = "{}/../../bin/toggle-display.sh".format(path) + + if bumblebee.util.asbool(self.parameter("overwrite_i3config", False)) == True: + toggle_cmd = "{}/../../bin/toggle-display.sh".format(path) + else: + toggle_cmd = "xrandr" widget = self.widget_by_id(event["instance"])