.dotfiles/configs/sway/scripts/toggle-bar

19 lines
479 B
Plaintext
Raw Normal View History

2022-03-14 19:21:46 +01:00
#!/bin/bash
GAPS=3
# How to get the current inner border from swaymsg
#$ echo $(swaymsg -t get_config | jq ".config") | sed -n '/gaps\ inner/p' | sed 's/gaps\ inner//g' | xargs
2022-04-08 15:47:38 +02:00
bar_mode="$(swaymsg -t get_bar_config bar-0 | jq '.mode')"
if [ "$bar_mode" != "dock" ]; then
swaymsg bar mode hide bar-0
2022-03-14 19:21:46 +01:00
swaymsg gaps outer all set 0;
swaymsg gaps inner all set 0;
else
2022-04-08 15:47:38 +02:00
swaymsg bar mode dock bar-0
2022-03-14 19:21:46 +01:00
swaymsg gaps outer all set $GAPS;
swaymsg gaps inner all set $GAPS;
fi