feat: introduce treefmt and fmt all

This commit is contained in:
steveej 2024-11-15 10:17:56 +01:00
parent 80250b0179
commit 27c6c4f9fa
237 changed files with 5440 additions and 5214 deletions

View file

@ -9,33 +9,33 @@ workspace_active=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused==tru
# If any of the outputs doesn't have a workspace, do nothing
if [ "$workspace1" = null ] || [ "$workspace2" = null ]; then
exit 0
exit 0
else
# If script is provided with `follow` argument, then follow focused workspace
if [ "$1" = "follow" ]; then
if [ "$workspace1" = "$workspace_active" ]; then
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
swaymsg workspace "$workspace2"
else
swaymsg workspace "$workspace1"
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
fi
# Else focus stays with focused output
# If script is provided with `follow` argument, then follow focused workspace
if [ "$1" = "follow" ]; then
if [ "$workspace1" = "$workspace_active" ]; then
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
swaymsg workspace "$workspace2"
else
if [ "$workspace1" = "$workspace_active" ]; then
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
else
swaymsg workspace "$workspace1"
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
swaymsg workspace "$workspace1"
fi
swaymsg workspace "$workspace1"
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
fi
# Else focus stays with focused output
else
if [ "$workspace1" = "$workspace_active" ]; then
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
else
swaymsg workspace "$workspace1"
swaymsg move workspace to output "$output2"
swaymsg workspace "$workspace2"
swaymsg move workspace to output "$output1"
swaymsg workspace "$workspace1"
fi
fi
fi