dotfiles/.config/hypr/scripts/changeLayout
2025-02-13 10:25:15 -07:00

27 lines
671 B
Bash
Executable File

#!/bin/bash
LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g')
case $LAYOUT in
"master")
hyprctl keyword general:layout dwindle
hyprctl keyword unbind SUPER,J
hyprctl keyword unbind SUPER,K
hyprctl keyword bind SUPER,J,cyclenext
hyprctl keyword bind SUPER,K,cyclenext,prev
hyprctl keyword bind SUPER,O,togglesplit
notify-send "Master Layout"
;;
"dwindle")
hyprctl keyword general:layout master
hyprctl keyword unbind SUPER,J
hyprctl keyword unbind SUPER,K
hyprctl keyword unbind SUPER,O
hyprctl keyword bind SUPER,J,layoutmsg,cyclenext
hyprctl keyword bind SUPER,K,layoutmsg,cycleprev
notify-send "Dwindle Layout"
;;
*) ;;
esac