.dotfiles/.config/sway/scripts/toggle-gaps

17 lines
420 B
Plaintext
Raw Permalink Normal View History

2021-11-24 14:29:06 +01:00
#!/bin/bash
2021-11-26 16:40:32 +01:00
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
2021-11-24 14:29:06 +01:00
2022-04-06 23:34:14 +02:00
if [ "$(ps cax | grep waybar$)" != "" ]; then
2021-11-24 14:29:06 +01:00
swaymsg gaps outer all set 0;
swaymsg gaps inner all set 0;
2022-04-06 23:34:14 +02:00
killall waybar;
2021-11-24 14:29:06 +01:00
else
2021-11-26 16:40:32 +01:00
swaymsg gaps outer all set $GAPS;
swaymsg gaps inner all set $GAPS;
2021-11-24 14:29:06 +01:00
nohup waybar & 2&> /dev/null;
fi