feat(sway): add toggle gaps script
This commit is contained in:
1
configs/sway/.gitignore
vendored
Normal file
1
configs/sway/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
nohup.out
|
@@ -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
14
configs/sway/toggle_gaps.sh
Executable 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
|
Reference in New Issue
Block a user