[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,7 +103,8 @@ class Module(core.module.Module):
|
||||||
widget = self.widget(widget_id=event["instance"])
|
widget = self.widget(widget_id=event["instance"])
|
||||||
|
|
||||||
if widget.get("state") == "on":
|
if widget.get("state") == "on":
|
||||||
util.cli.execute("{} --output {} --off".format(toggle_cmd, widget.name))
|
if len(self._active_displays) > 1:
|
||||||
|
util.cli.execute("{} --output {} --off".format(toggle_cmd, widget.name))
|
||||||
elif not self._active_displays:
|
elif not self._active_displays:
|
||||||
util.cli.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
util.cli.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue