[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
This commit is contained in:
Tobias Witek 2018-11-09 16:48:00 +01:00
parent 2f7931753e
commit c514d965cb

View file

@ -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.<screen name>" 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"])