From f09a93c7c08263619abfd0ca9a7afc6c9c3c2a8f Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Wed, 31 Jan 2024 00:52:24 +0000 Subject: [PATCH] Add selecthover script --- scripts/selecthover | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/selecthover diff --git a/scripts/selecthover b/scripts/selecthover new file mode 100755 index 0000000..d47e8e4 --- /dev/null +++ b/scripts/selecthover @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +CURSORPOS=$(hyprctl cursorpos -j) + +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 \ +"