16 lines
428 B
Bash
16 lines
428 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cur="$(hyprctl getoption general:layout 2>/dev/null | awk '/str:/ {print $2; exit}')"
|
|
if [[ "$cur" == "scrolling" ]]; then
|
|
new="dwindle"
|
|
else
|
|
new="scrolling"
|
|
fi
|
|
hyprctl keyword general:layout "$new" >/dev/null
|
|
msg="Hyprland layout: $new"
|
|
echo "$msg"
|
|
# Show a notification if possible
|
|
if command -v notify-send >/dev/null 2>&1; then
|
|
notify-send -a Hyprland "Layout switched" "$msg"
|
|
fi
|