From 6290ec2d0d4ba785e88aaed398283d0680c4339d Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 23 Oct 2020 10:16:11 +0200 Subject: [PATCH] Exclude disconnected primary output --- ecran | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecran b/ecran index c0b213f..9f80de6 100755 --- a/ecran +++ b/ecran @@ -53,7 +53,7 @@ The second connected output is: ${SECOND_OUTPUT_NAME}." get_primary_output_name() { # {{{ ## First, check if an output is already defined as primary - local_primary_output_name=$(xrandr | grep " primary" | awk 'NR==1{ print $1 }') + local_primary_output_name=$(xrandr | grep " primary" | grep -v " disconnected" | awk 'NR==1{ print $1 }') ## If the var contains something if [ -n "${local_primary_output_name}" ]; then