xprop: understanding set command
Asked Answered
R

1

5

I am trying to force a particular window to be always on top:

xprop -id 0x3800154 -set _NET_WM_STATE\(ATOM\) = _NET_WM_STATE_ABOVE

Debian buster reports:

xprop: error: unsupported conversion for _NET_WM_STATE(ATOM)

I have read https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm45408774010480

but cannot get my head around it.

Reeducate answered 15/3, 2020 at 8:25 Comment(0)
E
6

Your command is almost correct, it should be:

xprop -f _NET_WM_STATE 32a -id 0x3800154 -set _NET_WM_STATE _NET_WM_STATE_ABOVE
  • The most notable addition is the -f parameter. It specifies the format of the field _NET_WM_STATE. If this is not given, xprop does not know how to interpret the desired property value (_NET_WM_STATE_ABOVE).
  • According to the specification you provided, _NET_WM_STATE is a 32bit ATOM value (-f _NET_WM_STATE 32a).
  • The equals sign and \(ATOM\) are not required

A sidenote that might be useful: You can also specify multiple STATE values by comma-separating them, e.g.

xprop -f _NET_WM_STATE 32a -id 0x3800154 -set _NET_WM_STATE _NET_WM_STATE_ABOVE,_NET_WM_STATE_FULLSCREEN
Elsie answered 20/5, 2021 at 21:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.