Top «Prev(2008-10-27) Latest Next(2008-11-30)» Edit

pterjan's diary


2008-11-13

  Setting a X property using xprop

I have spent quite some time figuring out how to use xprop -set as the man page is not really useful. I had a window with _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL and wanted to set this property to _NET_WM_WINDOW_TYPE_UTILITY.

[pterjan@plop tmp]$ xprop -set _NET_WM_WINDOW_TYPE _NET_WM_WINDOW_TYPE_UTILITY                            
xprop: error: unsupported conversion for _NET_WM_WINDOW_TYPE

So I thought that maybe it doesn't know how to resolve to atom:

[pterjan@plop tmp]$ xlsatoms |grep _NET_WM_WINDOW_TYPE_UTILITY
407 _NET_WM_WINDOW_TYPE_UTILITY
[pterjan@plop tmp]$ xprop -set _NET_WM_WINDOW_TYPE 407  
 xprop: error: unsupported conversion for _NET_WM_WINDOW_TYPE

At this point I started looking on google and could only find people asking and no answer...

Then a friend suggested me xprop -f _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE 407 which sort of worked but the result was _NET_WM_WINDOW_TYPE(ATOM) = 407. So I tried xprop -f _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE _NET_WM_WINDOW_TYPE_UTILITY and it worked!

So, when setting a property, you have to specify its format. I would have loved to read this in the man page.

Today's TSUKKOMI(Total: 3) [Add a TSUKKOMI]
  Damien Pollet (2008-11-13 19:39)

Seems obvious to me… just like any half-decent language forces you to explicitly specify the static type of variables :)

  Vincent Untz (2008-11-14 13:09)

For this specific case, an easy solution is:<br>wnckprop --set-window-type=utility

  Benjamin Sergeant (2008-11-20 00:14)

XChangeProperty is the X11 function for that if you want to write your own tool (fun fun :)


2004|06|07|08|09|11|
2005|01|02|05|06|07|08|09|10|11|12|
2006|01|02|03|06|08|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|12|
2011|02|04|06|
2012|01|05|11|
2013|01|02|04|06|
2014|02|
2015|06|
2017|05|07|12|