From b5d1492373c7a0647bedee112b1a7f7520815379 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Mon, 3 Feb 2020 10:31:59 -0300 Subject: [PATCH] Ignore monitors that are disconnected --- pyproject.toml | 2 +- xrandroll/main.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7fd2f10..e7f3b6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "xrandroll" -version = "0.1.1" +version = "0.1.2" description = "A powertool to configure your display" authors = ["Roberto Alsina "] license = "MIT" diff --git a/xrandroll/main.py b/xrandroll/main.py index 88b8c10..0aedfda 100644 --- a/xrandroll/main.py +++ b/xrandroll/main.py @@ -312,7 +312,9 @@ class Window(QObject): data = subprocess.check_output(["xrandr"]).decode("utf-8").splitlines() name = None for line in data: - if line and line[0] not in "S \t": # Output line + if ( + line and line[0] not in "S \t" and "disconnected" not in line + ): # Output line ( name, primary,