wmctrl access to window's titles

84 views
Skip to first unread message

David Andel

unread,
Apr 23, 2017, 4:16:34 AM4/23/17
to qubes-devel
Hi all

I have posted this question on qubes-users a while ago without any reaction. And since I am a developer myself I am asking here as well for a way to solve this problem.


I am a new user of Qubes OS and I would like to keep monitoring which windows are active as I am doing since years. For this I am using a very much simplified version of ulogme: https://github.com/karpathy/ulogme - I don't need all the graphical analysis stuff, basically just the logactivewin.sh script.


The problem now is that wmctrl does not show the titles of windows from domains other than dom0:


[david@com0 ~]$ wmctrl -l
0x01400004 -1 dom0 xfce4-panel
0x01a00003 -1 dom0 Desktop
0x02c00012  0 dom0 Qubes VM Manager
0x04a00004  0 dom0 Terminal
0x04800017  1  N/A N/A
0x0480001f  1  N/A N/A
0x04800020  1  N/A N/A
0x04e00018  3  N/A N/A

The most it shows is the domain and the application using WM_CLASS:


[david@dom0 ~]$ wmctrl -lx
0x01400004 -1 xfce4-panel.Xfce4-panel  dom0 xfce4-panel
0x01a00003 -1 xfdesktop.Xfdesktop   dom0 Desktop
0x02c00012  0 qubes-manager.Qubes-manager  dom0 Qubes VM Manager
0x04a00004  0 xfce4-terminal.Xfce4-terminal  dom0 Terminal
0x04800017  1 untrusted:Navigator.untrusted:Firefox   N/A N/A
0x0480001f  1 untrusted:Navigator.untrusted:Firefox   N/A N/A
0x04800020  1 untrusted:Navigator.untrusted:Firefox   N/A N/A
0x04e00018  3 personal:Navigator.personal:Firefox   N/A N/A
0x0480004f  1 untrusted:gnome-terminal-server.untrusted:Gnome-terminal   N/A N/A


The window manager in dom0 shows the full titles of open windows, therefore I don't understand why wmctrl does not show them.


What is the issue here and how can I solve it? Is there any other way to access the windows titles of all domains from dom0 programmatically?


Thanks

Rusty Bird

unread,
Apr 23, 2017, 11:59:16 AM4/23/17
to David Andel, qubes-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

David Andel:
> The problem now is that wmctrl does not show the titles of windows from
> domains other than dom0:

wmctrl hardcodes the type of the X11 atom WM_NAME to STRING, but it is
UTF8_STRING for VM windows. (See "wmctrl -lv" and get_window_title()
in main.c.)

Try "xdotool getactivewindow getwindowname". You may have to install
the xdotool Fedora package in dom0.

Rusty
-----BEGIN PGP SIGNATURE-----

iQJ8BAEBCgBmBQJY/M9CXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4NEI1OUJDRkM2MkIxMjlGRTFCMDZEMDQ0
NjlENzhGNDdBQUYyQURGAAoJEEadePR6ryrfN0kP/R5zhEzQDIxvrCOUxC6C7ZLT
lHtILC0yj0ZfHDqH8cyVzq2fr54sYqx3ufq2QT+4rP0X2szkLfAmGWnGtj2DWX/n
eYRMRuSC68SgU3zUsf8zHoYLZp6KjlDD6/F9x6libQ5w0/+TuJmU5ajyAsXM3sI5
4Kh4gkpiMUWlONRGYtGU/ycYyVyC7zkRGtMFquIH5FSKtg5oq5h+4ZH7RTRCnYU9
14fec6Q1v18Wqkyc1JdiOGnEz6ZD+85LMqU1kJ8Lp+CUWFlgmuxOwlJXfP1waujw
Q/2wcsttpDVz/vw72KHITRZcOJxg/PX0nzs1AjW6fyOfE1c9fjni6GgXgkPb8qIN
VS/uCxbemoN4XbbpJBsqzTz/L1AeKeFoixAiJMAbWGWcOkKZO1gQ0C7GB9RKtFVn
yBTru5aAkX0+PuU+V6usvNr/MvK/4UvJpGOg6fcbpxMtLSKPQgqEV3gnJz88UHyb
KzUwj9bSmfmVgW/N8YSJQTN6GapWZUEuNvXwfF59wpItv0eTsdiVNzNg4fqiTo4G
li62ySbSZDpHGAuTuenQqRspXjm3Ia8JlPQf2iAX0PjIC5rTSIhCWGSzaI97NRgj
Uptjfef6jDMDHAA2t+fDKkS2/lOs94z65rFjZ/Q/7BHXVGf3jwaiOiFIstFrcOmE
pu6LBOUY+G38jytPDMTw
=OvnW
-----END PGP SIGNATURE-----

David Andel

unread,
Apr 24, 2017, 3:27:23 AM4/24/17
to qubes-devel, madsur...@gmail.com
Perfect! Thanks a lot!
Reply all
Reply to author
Forward
0 new messages