From b14eae4d6c3344d2d4c5cd2c243fdf315e419032 Mon Sep 17 00:00:00 2001 From: Naya Verdier Date: Sat, 25 Jul 2020 10:52:57 -0700 Subject: [PATCH] [xrandr] add safeguard to prevent turning off the only display --- bumblebee_status/modules/core/xrandr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bumblebee_status/modules/core/xrandr.py b/bumblebee_status/modules/core/xrandr.py index eee6be4..a3fe1b7 100644 --- a/bumblebee_status/modules/core/xrandr.py +++ b/bumblebee_status/modules/core/xrandr.py @@ -103,7 +103,8 @@ class Module(core.module.Module): widget = self.widget(widget_id=event["instance"]) 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: util.cli.execute("{} --output {} --auto".format(toggle_cmd, widget.name)) else: