mostly fixes, a few improvements
[distro-setup] / laptop-xrandr
1 #!/bin/bash
2 set -e; . /usr/local/lib/bash-bear; set +e
3
4
5 output=HDMI2
6 output=DP1
7
8 if xrandr | grep -q "^$output disconnected" &>/dev/null; then
9 xrandr --auto
10 else
11 xrandr --output $output --off
12 sleep 2
13 xrandr --output $output --right-of eDP1 --mode 3840x2160
14
15 for i in 1 2 4 5 6 7 8 9 10; do
16 # if the workspace is already there, this will fail
17 i3-msg '[workspace="'$i'"]' move workspace to output $output ||:
18 done
19 fi