From ccd620d6f44164d83475385d28d212a9f36c13da Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 21 Aug 2020 21:12:15 +0200 Subject: [PATCH] Manage second output with a var --- ecran | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ecran b/ecran index 4e51939..25deda4 100755 --- a/ecran +++ b/ecran @@ -52,29 +52,29 @@ main # This code can't be in a function due to arguments case "${1}" in ds | dockstation | work ) - xrandr --output DP-1 --mode 1920x1080 --left-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 + xrandr --output "${SECOND_OUTPUT:=/dev/null}" --mode 1920x1080 --left-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 printf 'Xrandr for DisplayPort with dock station';; home ) - xrandr --output DP-1 --mode 1920x1080 --right-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 + xrandr --output "${SECOND_OUTPUT:=/dev/null}" --mode 1920x1080 --right-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 printf 'Xrandr for home configuration';; vga ) xrandr --output VGA-1 --mode 1024x768 --right-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 printf 'Xrandr for dual screen with VGA';; hdmi | dp | displayport ) - xrandr --output HDMI-1 --mode 1920x1080 --above "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 + xrandr --output "${SECOND_OUTPUT:=/dev/null}" --mode 1920x1080 --above "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 printf 'Xrandr for dual screen with DisplayPort';; pres | prez | presentation ) xrandr --output VGA-1 --mode 1024x768 --left-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768 printf 'Xrandr for presentation';; - | off ) - xrandr --output "${MAIN_SCREEN:=/dev/null}" --mode 1360x768 --output HDMI-1 --off --output VGA-1 --off --output HDMI-3 --off --output DP-1 --off + xrandr --output "${MAIN_SCREEN:=/dev/null}" --mode 1360x768 --output "${SECOND_OUTPUT:=/dev/null}" --off --output VGA-1 --off --output HDMI-3 --off --output "${SECOND_OUTPUT:=/dev/null}" --off xrandr --output VGA --off printf 'Desactivate all video output';; out ) - xrandr --output HDMI-3 --mode 1920x1080 --output "${MAIN_SCREEN:=/dev/null}" --off + xrandr --output "${SECOND_OUTPUT:=/dev/null}" --mode 1920x1080 --output "${MAIN_SCREEN:=/dev/null}" --off ;; game ) - xrandr --output HDMI-1 --mode 1680x1050 --output "${MAIN_SCREEN:=/dev/null}" --off + xrandr --output "${SECOND_OUTPUT:=/dev/null}" --mode 1680x1050 --output "${MAIN_SCREEN:=/dev/null}" --off ;; first_off | main_off | laptop_off ) xrandr --output "${MAIN_SCREEN:=/dev/null}" --off