Skip to content

Commit

Permalink
[modules/xrandr] Do not overwrite i3 config by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tobi-wan-kenobi committed Nov 9, 2018
1 parent 2f79317 commit c514d96
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bumblebee/modules/xrandr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -52,7 +57,11 @@ def state(self, widget):

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"])

Expand Down

0 comments on commit c514d96

Please sign in to comment.