Use a var for the main screen

This commit is contained in:
Jeremy Gardais 2020-08-21 19:58:25 +02:00
parent e3ddfa74ec
commit 86d334ca21
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 14 additions and 10 deletions

24
ecran
View File

@ -2,35 +2,39 @@
# Description: Manage video output (size, orientation, ...) # Description: Manage video output (size, orientation, ...)
# And reload wm configuration # And reload wm configuration
#
# $1: a directory with images to convert or a image file path # First and main screen (laptop screen,…)
MAIN_SCREEN="LVDS-1"
case "${1}" in case "${1}" in
ds | dockstation | work ) ds | dockstation | work )
xrandr --output DP-1 --mode 1920x1080 --left-of LVDS-1 --output LVDS-1 --mode 1366x768 xrandr --output DP-1 --mode 1920x1080 --left-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768
printf 'Xrandr for DisplayPort with dock station';; printf 'Xrandr for DisplayPort with dock station';;
home ) home )
xrandr --output DP-1 --mode 1920x1080 --right-of LVDS-1 --output LVDS-1 --mode 1366x768 xrandr --output DP-1 --mode 1920x1080 --right-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768
printf 'Xrandr for home configuration';; printf 'Xrandr for home configuration';;
vga ) vga )
xrandr --output VGA-1 --mode 1024x768 --right-of LVDS-1 --output LVDS-1 --mode 1366x768 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';; printf 'Xrandr for dual screen with VGA';;
hdmi | dp | displayport ) hdmi | dp | displayport )
xrandr --output HDMI-1 --mode 1920x1080 --above LVDS-1 --output LVDS-1 --mode 1366x768 xrandr --output HDMI-1 --mode 1920x1080 --above "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768
printf 'Xrandr for dual screen with DisplayPort';; printf 'Xrandr for dual screen with DisplayPort';;
pres | prez | presentation ) pres | prez | presentation )
xrandr --output VGA-1 --mode 1024x768 --left-of LVDS-1 --output LVDS-1 --mode 1366x768 xrandr --output VGA-1 --mode 1024x768 --left-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768
printf 'Xrandr for presentation';; printf 'Xrandr for presentation';;
- | off ) - | off )
xrandr --output LVDS-1 --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 HDMI-1 --off --output VGA-1 --off --output HDMI-3 --off --output DP-1 --off
xrandr --output VGA --off xrandr --output VGA --off
printf 'Desactivate all video output';; printf 'Desactivate all video output';;
out ) out )
xrandr --output HDMI-3 --mode 1920x1080 --output LVDS-1 --off xrandr --output HDMI-3 --mode 1920x1080 --output "${MAIN_SCREEN:=/dev/null}" --off
;; ;;
game ) game )
xrandr --output HDMI-1 --mode 1680x1050 --output LVDS-1 --off xrandr --output HDMI-1 --mode 1680x1050 --output "${MAIN_SCREEN:=/dev/null}" --off
;;
first_off | main_off | laptop_off )
xrandr --output "${MAIN_SCREEN:=/dev/null}" --off
;; ;;
* ) * )
printf 'Bad argument, please use [vga|hdmi|ds|work|-|off]' printf 'Bad argument, please use [vga|hdmi|ds|work|-|off]'