# submaps
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# will switch to a submap called resize
-bind = $mainmod, R, submap, resize
+bind = $mainmod, R, submap, resize
# will start a submap called "resize"
submap = resize
submap = reset
+# ───────────────────────────────────────────────────────────
+# will switch to a submap called gaps
+bind = $mainmod ALT, G, submap, gaps
+
+# will start a submap called "gaps"
+submap = gaps
+
+# sets repeatable binds for resizing the active window
+binde = , l, exec, ~/.config/hypr/scripts/gaps.sh --inc_gaps_in
+binde = , h, exec, ~/.config/hypr/scripts/gaps.sh --dec_gaps_in
+binde = , j, exec, ~/.config/hypr/scripts/gaps.sh --inc_gaps_out
+binde = , k, exec, ~/.config/hypr/scripts/gaps.sh --dec_gaps_out
+binde = , i, exec, ~/.config/hypr/scripts/gaps.sh --reset_gaps_in
+binde = , o, exec, ~/.config/hypr/scripts/gaps.sh --reset_gaps_out
+
+# use reset to go back to the global submap
+bind = , catchall, submap, reset
+
+# will reset the submap, which will return to the global submap
+submap = reset
+
+
# mouse binds
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# Move/resize windows with mainMod + LMB/RMB and dragging
--- /dev/null
+#!/bin/bash
+
+gaps_in=$(hyprctl -j getoption general:gaps_in | jq '.custom' | awk '{print $2}')
+gaps_out=$(hyprctl -j getoption general:gaps_out | jq '.custom' | awk '{print $2}')
+
+function inc_gaps_in () {
+ hyprctl keyword general:gaps_in $((gaps_in+5))
+}
+
+function dec_gaps_in () {
+ hyprctl keyword general:gaps_in $((gaps_in-5))
+}
+
+function reset_gaps_in () {
+ hyprctl keyword general:gaps_in 5
+}
+
+function zero_gaps_in () {
+ hyprctl keyword general:gaps_in 0
+}
+
+function inc_gaps_out () {
+ hyprctl keyword general:gaps_out $((gaps_out+5))
+}
+
+function dec_gaps_out () {
+ hyprctl keyword general:gaps_out $((gaps_out-5))
+}
+
+function reset_gaps_out () {
+ hyprctl keyword general:gaps_out 10
+}
+
+function zero_gaps_out () {
+ hyprctl keyword general:gaps_out 0
+}
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --inc_gaps_in) inc_gaps_in; shift ;;
+ --dec_gaps_in) dec_gaps_in; shift ;;
+ --reset_gaps_in) reset_gaps_in; shift ;;
+ --zero_gaps_in) zero_gaps_in; shift ;;
+ --inc_gaps_out) inc_gaps_out; shift ;;
+ --dec_gaps_out) dec_gaps_out; shift ;;
+ --reset_gaps_out) reset_gaps_out; shift ;;
+ --zero_gaps_out) zero_gaps_out; shift ;;
+ *) printf "Error: Unknown option %s" "$1"; exit 1 ;;
+ esac
+done
+