Skip to content

Instantly share code, notes, and snippets.

@erikh
Created April 28, 2021 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikh/cf01b7f07486c8db570536e07a913104 to your computer and use it in GitHub Desktop.
Save erikh/cf01b7f07486c8db570536e07a913104 to your computer and use it in GitHub Desktop.
#!env bash
case "$1" in
boot)
(sleep 5 && 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 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-1 enable
sway output DP-1 transform normal
sway output DP-2 disable
sway output DP-3 disable
;;
focus)
sway output DP-2 enable
sway output DP-2 transform normal
sway output DP-2 transform 90 clockwise
sway output DP-1 disable
sway output DP-3 disable
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment