[xrandr] add safeguard to prevent turning off the only display
This commit is contained in:
parent
5874850bd5
commit
b14eae4d6c
1 changed files with 2 additions and 1 deletions
|
@ -103,6 +103,7 @@ class Module(core.module.Module):
|
|||
widget = self.widget(widget_id=event["instance"])
|
||||
|
||||
if widget.get("state") == "on":
|
||||
if len(self._active_displays) > 1:
|
||||
util.cli.execute("{} --output {} --off".format(toggle_cmd, widget.name))
|
||||
elif not self._active_displays:
|
||||
util.cli.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
||||
|
|
Loading…
Reference in a new issue