You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getActiveWindow function is not working as expected on Linux systems using the dwm window manager. The function is expected to return the title of the currently active window, but instead, it's throwing an error.
Here's the code that I'm trying to run:
importpywinctlaspwcimporttimedefget_active_window_title():
# Get the active windowactive_window=pwc.getActiveWindow()
ifactive_window:
# Get the title of the active windowreturnactive_window.titleelse:
return"No active window found"# Example usagewhileTrue:
print(get_active_window_title())
time.sleep(3)
I've fixed on my system by adding this code to top of my file
importosos.environ['XDG_CURRENT_DESKTOP'] ='dwm'
It's working for now, but exhibits strange behavior, logs No active window found for the windows where this file is being executed — pycharm in this case
Skype - Google Chrome
Skype - Google Chrome
Skype - Google Chrome
recluzegeek@alpha:~
DBeaver 24.0.0 - screenshots
DBeaver 24.0.0 - screenshots
DBeaver 24.0.0 - screenshots
recluzegeek@alpha:~
recluzegeek@alpha:~
New Issue · Kalmat/PyWinCtl — LibreWolf
New Issue · Kalmat/PyWinCtl — LibreWolf
recluzegeek@alpha:~
New Issue · Kalmat/PyWinCtl — LibreWolf
No active window found
No active window found
No active window found
New Issue · Kalmat/PyWinCtl — LibreWolf
No active window found
No active window found
Traceback (most recent call last):
File "/mnt/win/cedar/cedar-workfolio-desktop-app/src/active_window.py", line 19, in <module>
# Example usage
^^^^^^^^^^^^
KeyboardInterrupt
Process finished with exit code 130 (interrupted by signal 2:SIGINT)
I'm developing an desktop app to keep track of my system usage and it'll be annoying to set up XDG_CURRENT_DESKTOP key manually for all other window managers.
The text was updated successfully, but these errors were encountered:
Sorry I don't know about DWM. As I could find, it is not EWMH-compliant. Since PyWinCtl heavily relies in EWMH protocol, it will not likely work or, in the best case, some issues will arise. Not sure, but I think that DWM uses a very specific and privative control protocol called dwmfifo instead.
The issue regarding XDG_CURRENT_DESKTOP is already fixed in next version (assuming empty instead of crashing, but not sure if this will work in your case. I mean, it is not filling it with 'dwm' nor any other value).
About the second crash, it is outside PyWinCtl module. No idea about where, to be honest. Most likely it is because of DWM not being compliat with EWMH specs.
As I could also find, there is a DWM fork called awesome which adds support for EWMH, amongst other features like XCB or Lua. Is it possible you switch to this one?
The
getActiveWindow
function is not working as expected on Linux systems using the dwm window manager. The function is expected to return the title of the currently active window, but instead, it's throwing an error.Here's the code that I'm trying to run:
Here's the error message:
I've fixed on my system by adding this code to top of my file
It's working for now, but exhibits strange behavior, logs No active window found for the windows where this file is being executed — pycharm in this case
I'm developing an desktop app to keep track of my system usage and it'll be annoying to set up
XDG_CURRENT_DESKTOP
key manually for all other window managers.The text was updated successfully, but these errors were encountered: