Update selecthover

This commit is contained in:
2024-02-11 23:52:30 +00:00
parent e8ae1cae07
commit 81c55bd08c

View File

@@ -2,9 +2,20 @@
CURSORPOS=$(hyprctl cursorpos -j)
X_POS=$(jq '.x' <<< $CURSORPOS)
Y_POS=$(jq '.y' <<< $CURSORPOS)
ACTIVE_WORKSPACE=$(hyprctl activeworkspace -j | jq '.id')
hyprctl clients -j | jq ".[] | \
select(.workspace.id == $ACTIVE_WORKSPACE) | \
select(.at[0] <= $(jq '.x' <<< $CURSORPOS) and .at[1] <= $(jq '.y' <<< $CURSORPOS) and (.at[0] + .size[0] >= $(jq '.x' <<< $CURSORPOS)) and (.at[1] + .size[1] >= $(jq '.y' <<< $CURSORPOS))) | .pid \
"
hyprctl clients -j | jq "$(cat << EOF
.[] |
select(.workspace.id == $ACTIVE_WORKSPACE) |
select(
.at[0] <= $X_POS
and .at[1] <= $Y_POS
and (.at[0] + .size[0] >= $X_POS)
and (.at[1] + .size[1] >= $Y_POS)
) | .pid
EOF
)" | tail -n 1