From bc78b9be1ba1ca19d09dc72aa4faa5012e17fdc1 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 17 Mar 2021 07:58:40 +0100 Subject: [PATCH] Use loaded var if available --- ecran | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ecran b/ecran index 319bc5a..eb10bcf 100755 --- a/ecran +++ b/ecran @@ -145,7 +145,11 @@ case "${1}" in ;; leftof | left-of | ds | dock | dockstation | work ) #xrandr --output VGA-1 --mode 1024x768 --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --mode 1366x768 - xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto + if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then + xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --mode "${PRIMARY_OUTPUT_MODE}" + else + xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto + fi printf "%b\n" 'Xrandr for second output left-of primary screen' ;; rightof | right-of | home )