feat(sway): add toggle gaps script

This commit is contained in:
2021-11-24 14:29:06 +01:00
parent f0b2030246
commit 3bea84ce68
7 changed files with 179 additions and 3 deletions

1
configs/sway/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
nohup.out

View File

@@ -24,6 +24,7 @@ set $screenclip slurp | grim -g - ~/Pictures/Screenshots/scrn-$(date +"%Y-%m-%d-
set $screenshot grim ~/Pictures/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $windowshot swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | $screenclip
set $toggle_layout ~/.config/sway/toggle_layout.sh
set $toggle_gaps ~/.config/sway/toggle_gaps.sh
# Input configuration
@@ -180,6 +181,7 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill
# Switch the current container between different layout styles
bindsym $mod+w exec $toggle_layout
bindsym $mod+g exec $toggle_gaps
# Make the current focus fullscreen
bindsym $mod+f fullscreen

14
configs/sway/toggle_gaps.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
GAPS_OUTER=5
GAPS_INNER=1
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_OUTER;
swaymsg gaps inner all set $GAPS_INNER;
nohup waybar & 2&> /dev/null;
fi