wmutils / core

Set of window manipulation tools
Other
714 stars 33 forks source link

atomx: WM_CLASS only returns the instance value (not class) #69

Open Aicaya opened 2 years ago

Aicaya commented 2 years ago

Pretty much what the title says: WM_CLASS contains two strings (instance, class), but atomx WM_CLASS $(pfw) only returns the first of them (the instance).

Found out while writing window rules for a wmutils-only setup. Currently making-do with xprop -id "$wid" WM_CLASS and a bunch of clean-up, but having atomx output both would help simplify things.

lwilletts commented 2 years ago

Agreed. An example I found was picom expected class from your example when defining classes e.g. for opacity rules.

z3bra commented 2 years ago

It seems like the atom value returned sends the class and instance terminated with a nullbyte. Currently atomx simply prints the value with printf(3), so the first nullbyte (after the class name) marks the end of the string. Printing the instance name would require printing the whole data returned, either by writing the full data to stout (including the intermediate null bytes), or iterating through the whole data, and reformatting it. Not sure how it should be formatted though (tab separated, new line, ...?).