hyprdots/Configs/.local/share/bin/windowpin.sh
2024-12-10 23:54:56 +01:00

21 lines
669 B
Bash
Executable file

#!/usr/bin/env sh
# enable float
WinFloat=$(hyprctl -j clients | jq '.[] | select(.focusHistoryID == 0) | .floating')
WinPinned=$(hyprctl -j clients | jq '.[] | select(.focusHistoryID == 0) | .pinned')
if [ "${WinFloat}" == "false" ] && [ "${WinPinned}" == "false" ] ; then
hyprctl dispatch togglefloating active
fi
# toggle pin
hyprctl dispatch pin active
# disable float
WinFloat=$(hyprctl -j clients | jq '.[] | select(.focusHistoryID == 0) | .floating')
WinPinned=$(hyprctl -j clients | jq '.[] | select(.focusHistoryID == 0) | .pinned')
if [ "${WinFloat}" == "true" ] && [ "${WinPinned}" == "false" ] ; then
hyprctl dispatch togglefloating active
fi