Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting X11 "type" property for xmessage

Tags:

x11

Is it possible to set the X11 "type" property (_NET_WM_WINDOW_TYPE) of a dialog box generated by the xmessage command to "dialog" (which I would have thought would be the default)?

In other words, I want to create a dialog box from the command line and set the _NET_WM_WINDOW_TYPE attribute:

> xmessage "message text" &   # (plus relevant xmessage opts)
[1] 25396                     # (or similar)
> # command to set _NET_WM_WINDOW_TYPE for this window?
like image 522
Kyle Strand Avatar asked Sep 07 '25 23:09

Kyle Strand


1 Answers

To set a window type:

xprop -id <your-window-ID> \
      -f _NET_WM_WINDOW_TYPE 32a \
      -set _NET_WM_WINDOW_TYPE _NET_WM_WINDOW_TYPE_DIALOG

I don't know an easy automated way to find out window ID of an xmessage window. You can do this:

xmessage -xrm <some-dummy-name>:<some-unique-string> <your-other-options>

-xrm is an old generic X11 resource management option. xmessage understands it and ignores unknown resources, so you can pass anything you like.

Then you can use xlsclients -l and use some kind of perl script to search for a window ID that has some-unique-string in its command.

like image 68
n. 1.8e9-where's-my-share m. Avatar answered Sep 10 '25 22:09

n. 1.8e9-where's-my-share m.