Use slurp -o to select outputs instead of parsing swaymsg -t get_tree

This commit is contained in:
Ragnar Groot Koerkamp 2021-06-25 13:07:23 +02:00
parent 49545189ac
commit f752aa7629

View file

@ -137,7 +137,7 @@ elif [ "$SUBJECT" = "window" ] ; then
fi fi
WHAT="Window" WHAT="Window"
elif [ "$SUBJECT" = "selection" ] ; then elif [ "$SUBJECT" = "selection" ] ; then
GEOM=$(swaymsg -t get_tree | jq -r '.. | select((.pid? and .visible?) or (.type == "output" and .active)) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp -o)
# Check if user exited slurp without selecting the area # Check if user exited slurp without selecting the area
if [ -z "$GEOM" ]; then if [ -z "$GEOM" ]; then
exit exit