On Wayland is there a way today to get the currently focused windows title and process ID?
Asked Answered
B

1

18

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?

Bellamy answered 3/5, 2020 at 13:42 Comment(2)
Was looking for the same none of my "fetch if open, else create" window tools work anymore.Blend
Maybe this can help you.Wallacewallach
C
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.

Cringle answered 31/3, 2023 at 20:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.