Python
如何通过Python/DBus在 KDE Plasma 6(Wayland)中获取活动窗口标题?
我在基于 CachyOS(Arch Linux) 的 KDE Plasma 6(Wayland) 上进行一个语音转文本项目(Python)。我需要获取活动窗口的标题,以便对输入进行上下文感知的处理。 问题: 基于X11的标准解决方案(如 xdotool 或 xprop)在原生Wayland窗口上会失败,并抛出 BadWindow 错误: XGetWindowProperty\[\_NET_ACTIVE_WINDOW\] failed (code=1) xdo_get_active_window repor