textmon - scripts - random scripts
HTML git clone https://git.parazyd.org/scripts
DIR Log
DIR Files
DIR Refs
---
textmon (983B)
---
1 #!/bin/sh
2 #
3 # parazyd - (c) wtfpl 2017
4 # skreenz
5
6 IN="${IN:-eDP-1}"
7 EXT="${EXT:-HDMI-2}"
8
9
10 setmon() {
11 pos="$1"
12 #xrandr --output LVDS-1 --off
13 xrandr --output $IN --auto --primary --output $EXT --auto --${pos} $IN
14 setwall
15 }
16
17 case "$1" in
18 left|l) setmon left-of ;;
19 right|r) setmon right-of ;;
20 above|a) setmon above ;;
21 dup|d)
22 #xrandr --output LVDS-1 --off
23 xrandr --output $EXT --same-as $IN --output $IN --primary
24 feh --no-fehbg --bg-fill "$WALL"
25 ;;
26 tv)
27 #xrandr --output LVDS-1 --off
28 xrandr --output $IN --auto --primary --output $EXT --mode 1920x1080 --above $IN
29 xrandr --output $EXT --set "Broadcast RGB" "Full"
30 setwall
31 ;;
32 off|o)
33 xrandr --output $IN --auto --output $EXT --off --output HDMI-1 --off
34 xrandr --output $IN --auto
35 #xrandr --output HDMI1 --off
36 setwall
37 ;;
38 list)
39 xrandr | grep \<connected\> | cut -d\ -f1
40 ;;
41 *)
42 printf "%s {left|right|above|dup|off|list}\\n" "$(basename $0)"
43 printf "overridable env vars: IN, EXT\\n"
44 ;;
45 esac