This commit is contained in:
Karakurt 2023-07-27 18:12:56 +08:00 committed by GitHub
commit 8f391060c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,10 +131,11 @@ elif [ "$SUBJECT" = "area" ] ; then
fi
WHAT="Area"
elif [ "$SUBJECT" = "active" ] ; then
FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)')
GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"')
APP_ID=$(echo "$FOCUSED" | jq -r '.app_id')
WHAT="$APP_ID window"
eval "$( swaymsg -t get_tree |\
jq -r '..|try select(.focused == true)|
"GEOM=\"\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)\"
APP_ID=\"\(.app_id)\"
WHAT=\"\(.app_id) window\""' )"
elif [ "$SUBJECT" = "screen" ] ; then
GEOM=""
WHAT="Screen"