15

On X11 I used to use xprop to get information about active windows but on Wayland that tool doesn't work anymore. There have been questions like this, or this one which ask basically the same question as I do, and the answer is: no, this is not intended and won't be supported by Wayland.

This is why I won't switch to Wayland until I'm forced to, but maybe Wayland has changed since 2017?

So I rephrase the question: as today, is there a way to programmatically get the currently active window title and PID on Wayland?

Maybe even a convienient Python library?

frans
  • 8,868
  • 11
  • 58
  • 132
  • 2
    Was looking for the same none of my "fetch if open, else create" window tools work anymore. – RichieHH Aug 04 '20 at 10:04
  • Maybe [this](https://unix.stackexchange.com/questions/362731/how-to-identify-window-by-clicking-in-wayland) can help you. – accdias Aug 12 '20 at 16:12

1 Answers1

0

My method of doing this (which is scuffed but works) is to use Rofi in Window mode.

rofi -show window

It'll bring up a little list of the currently open windows, as well as their titles and descriptions. Knowing window titles, I bet you could find PIDs.

dodrg
  • 1,142
  • 2
  • 18
T1 L.
  • 1
  • 4