From 81c55bd08c34cfafd87ae4cb023b049ac871ada9 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Sun, 11 Feb 2024 23:52:30 +0000 Subject: [PATCH] Update selecthover --- scripts/selecthover | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/selecthover b/scripts/selecthover index d47e8e4..aafe0b2 100755 --- a/scripts/selecthover +++ b/scripts/selecthover @@ -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 +