scripts/ecran

49 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-09-25 23:37:13 +02:00
#! /bin/sh
# Description: Manage video output (size, orientation, ...)
# And reload wm configuration
2020-08-21 19:58:25 +02:00
# First and main screen (laptop screen,…)
MAIN_SCREEN="LVDS-1"
2014-09-25 23:37:13 +02:00
case "${1}" in
ds | dockstation | work )
2020-08-21 19:58:25 +02:00
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';;
home )
2020-08-21 19:58:25 +02:00
xrandr --output DP-1 --mode 1920x1080 --right-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768
printf 'Xrandr for home configuration';;
2019-11-23 12:17:50 +01:00
vga )
2020-08-21 19:58:25 +02:00
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 )
2020-08-21 19:58:25 +02:00
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';;
pres | prez | presentation )
2020-08-21 19:58:25 +02:00
xrandr --output VGA-1 --mode 1024x768 --left-of "${MAIN_SCREEN:=/dev/null}" --output "${MAIN_SCREEN:=/dev/null}" --mode 1366x768
printf 'Xrandr for presentation';;
- | off )
2020-08-21 19:58:25 +02:00
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
printf 'Desactivate all video output';;
out )
2020-08-21 19:58:25 +02:00
xrandr --output HDMI-3 --mode 1920x1080 --output "${MAIN_SCREEN:=/dev/null}" --off
;;
game )
2020-08-21 19:58:25 +02:00
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]'
exit 1;;
2014-09-25 23:37:13 +02:00
esac
herbstclient detect_monitors
herbstclient reload
exit 0