I searched internet and found examples with setting only one field of property:
xprop -id "$windowid" -f _NET_WM_STATE 32a -set _NET_WM_STATE _NET_WM_STATE_ABOVE
but how can I set multiple fields? I tried:
xprop -id "$windowid" -f _NET_WM_STATE 32a -set _NET_WM_STATE '_NET_WM_STATE_ABOVE, _NET_WM_STATE_SKIP_TASKBAR'
and
xprop -id "$windowid" -f _NET_WM_STATE 32aa -set _NET_WM_STATE _NET_WM_STATE_ABOVE,_NET_WM_STATE_SKIP_TASKBAR
and many other variants with no luck. Is it possible ? :)
I wrote a patch for xprop to fix this, and It works, but don't know is it correct.
Thanks to @MichałGórny.
(xprop.c,v 1.6)
--- xprop.c 2012-07-31 11:24:01.178117974 +0400
+++ xprop.mod 2012-07-31 11:23:19.434784430 +0400
@@ -1487,11 +1487,20 @@
break;
}
case 'a': {
- static Atom avalue;
- avalue = Parse_Atom(value, False);
- type = XA_ATOM;
- data = (unsigned char *) &avalue;
- nelements = 1;
+ static unsigned long data32[MAXELEMENTS];
+ char * value2 = strdup(value);
+ char * tmp = strtok(value2,",");
+ nelements = 0;
+ while( NULL != tmp ){
+ data32[nelements] = Parse_Atom(tmp, False);
+ nelements +=1;
+ if(nelements >= MAXELEMENTS)
+ break;
+ tmp = strtok(NULL,",");
+ }
+ type = XA_ATOM;
+ data = (unsigned char *) data32;
+ free(value2);
break;
}
case 'm':
Looking at the xprop's code, it's not possible.
case 'a': {
static Atom avalue;
avalue = Parse_Atom(value, False);
type = XA_ATOM;
data = (unsigned char *) &avalue;
nelements = 1;
break;
}
This is the code parsing the value to -set
.
static Atom
Parse_Atom (const char *name, int only_if_exists)
{
/* may return None = 0 */
return XInternAtom(dpy, name, only_if_exists);
}
So it parses only a single atom.
I've also opened a bug for it; maybe they'll add this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With