Última actividad 1731166690

xmon.sh Sin formato
1#!/bin/sh
2# Practical script to adjust my monitor layout on ma X1 laptop
3# Dominic Reich <quick.hat4396@qtztsjosmprqmgtunjyf.com>
4
5internal="eDP-1"
6external="HDMI-1"
7
8print_usage () {
9 echo >&2 "usage: $(basename ${0}) [normal;wide;dup]"
10 exit 0
11}
12
13if [ $# -eq 1 ]
14then
15 case "$1" in
16 "normal"|"n"|"norm")
17 xrandr --output "$external" --off --output "$internal" --auto
18 dunstify "Multimonitor setup" "set to normal ($internal)"
19 ;;
20 "wide"|"w")
21 xrandr --output "$external" --set audio force-dvi --mode 1920x1080
22 xrandr --output "$internal" --auto --output "$external" --right-of "$internal"
23 dunstify "Multimonitor setup" "set to wide ($internal + $external (right-of))"
24 ;;
25 "duplicate"|"dup"|"d")
26 xrandr --output "$external" --set audio force-dvi --mode 1920x1080
27 xrandr --output "$internal" --auto --output "$external" --same-as "$internal"
28 dunstify "Multimonitor setup" "set to duplicate ($internal; $external)"
29 ;;
30 *)
31 dunstify -u critical "Multimonitor setup failed" "no such operation: ${1}"
32 ;;
33 esac
34else
35 print_usage
36fi
37