.dotfiles/configs/sway/toggle_bar.sh

17 lines
411 B
Bash
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
if [ "$(pgrep waybar)" != "" ]; then
killall waybar;
swaymsg gaps outer all set 0;
swaymsg gaps inner all set 0;
else
swaymsg gaps outer all set $GAPS;
swaymsg gaps inner all set $GAPS;
nohup waybar & 2&> /dev/null;
fi