Make sure you have installed the following commands:
- swaymsg
- jq
- slurp
- awk
curl -L https://gist.github.com/crispyricepc/f313386043395ff06570e02af2d9a8e0/raw/8b06f025a0f34685f5ffc2000fd19a64754c9b29/wlprop.sh > ~/.local/bin/wlprop
chmod +x ~/.local/bin/wlprop
Type wlprop
in a terminal, then click the window you'd like to get the properties of.
Since all wlprop
outputs is JSON, you can filter the values you need using jq
:
# Get just the name of the window
wlprop | jq -r '.name'
# Get the app_id value (useful for `for_window` configs in sway)
wlprop | jq -r '.app_id'
@magicmonty Excellent, just what I needed! Thank you very much.
However, there's a small typo at
L11:67
: you pass--argsjon
instead of--argjson
. 😉