Skip to content

Instantly share code, notes, and snippets.

@erikh

erikh/monitors

Created Apr 29, 2021
Embed
What would you like to do?
#!env bash
case "$1" in
boot)
(sleep 1 && bash $0 fix) &
;;
fix)
exec &>/dev/null
# transform monitors to form a vertical wall
for i in DP-1 DP-2 DP-3
do
sway output $i enable
sway output $i dpms on
sway output $i transform normal
sway output $i transform 90 clockwise
done
# reset workspace positioning
sway '[workspace=1] move workspace to output DP-2'
sway '[workspace=2] move workspace to output DP-1'
sway '[workspace=3] move workspace to output DP-3'
sway '[workspace=4] move workspace to output DP-2'
sway '[workspace=5] move workspace to output DP-1'
sway '[workspace=6] move workspace to output DP-3'
sway '[workspace=7] move workspace to output DP-2'
sway '[workspace=8] move workspace to output DP-1'
sway '[workspace=9] move workspace to output DP-3'
sway 'workspace 1'
sway 'workspace 3'
sway 'workspace 2'
;;
share)
sway output DP-3 dpms on
sway output DP-3 enable
sway output DP-3 transform normal
sway output DP-2 dpms off
sway output DP-2 disable
sway output DP-1 dpms off
sway output DP-1 disable
;;
focus)
sway output DP-1 dpms on
sway output DP-1 enable
sway output DP-1 transform normal
sway output DP-1 transform 90 clockwise
sway output DP-2 dpms off
sway output DP-2 disable
sway output DP-3 dpms off
sway output DP-3 disable
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment