Created
April 29, 2021 09:39
-
-
Save erikh/36db9fccea81d7a220905ce43e9541dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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