-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with pymonctl.getAllMonitorsDict()
on Linux Mint and Arch Linux
#86
Comments
TypeError: 'NoneType' object is not subscriptable
on Arch linux when using pymonctl.getAllMonitorsDict()
pymonctl.getAllMonitorsDict()
on Linux Mint and Arch Linux
Hi! Thanks A LOT for your feedback!!! Sorry I've been extremely busy, so I had no time to finish and fully test next version of all involved modules (PyWinBox, PyMonCtl and PyWinCtl)... I hope to be able to test everything soon, so I can eventually upload all these new versions which fix tones of issues and improves some other features. In your case, this is how that part of the code looks now:
Linux and all possible combinations is particularly complex (well, it's sort of a nightmare, to be hones), so testing everything takes a lot. I hope you can wait!!!! In the meantime, do not hesitate to arise any comment, issue or suggestion you may have. Thanks again!!! EDIT: Did you fix the other issue regarding DWM? Is |
Thanks for the quick reply. I'll look into your provided code snippet and come back to you once I test it. Shifting to EDIT: I tested these lines of code in windows, linux mint and arch running dwm and all of them passed, except on arch empty list and dictionary were returned import pywinctl
print(pywinctl.getAllTitles())
print(pywinctl.getAllAppsWindowsTitles())
# ------------------------
# RESULT ON ARCH
[]
{}
Process finished with exit code 0 |
HAHAHAHA! Sorry. SInce it says I guess you mean that you have tested Mint and Arch together with Thanks! |
No worries, I too was confused in my early linux days. It happens and IMO its normal :) I've tested arch with |
Ah, ok! That's why Mint works, whilst Arch doesn't... Arch with other desktop/window managers works if those managers are EWMH-compliant. I already have actual installs of Ubuntu/GNOME (Wayland is not working since it's not EMWH-compliant, Linux Mint/Cinnamon and Manjaro/KDE; but not Arch yet, sorry. |
Manjaro actually is derived from Arch, as Mint is derived of Ubuntu. If it works on Manjaro, then it also should be working in arch. Issue itself is not in the arch, rather in the desktop/windows manager. In this case, dwm doesn't seems to be EWMH-compliant. I created this git issue for mint on this issue, Arch with |
Yes, that's correct. EMWH-compliance depends on the Desktop/Windows Manager, not the OS. E.g. in "standard" Ubuntu, GNOME is EWMH-compliant, but Wayland is not (furthermore, there is no way in Wayland to get the list of windows nor the active one... I mean, that feature is not supported at all, even using any other protocol to communicate with it) I hope to be able to start all tests soon, which include Mint/Cinnamon amongst many other combinations. I will keep you posted on any progress. Hopefully I will have a complete new version ready to be uploaded so all these issues are fixed. Please, bear in mind that non-EWMH window managers (like dwm) will still not work with the new version, since it will inevitably continue to rely on EWMH to handle windows. Back to the initial issue, and just if you are curious, this is a snippet of the new version, which includes a workaround specifically for Cinnamon:
|
Hi there again. This time I'm not creating a new issue, 😄 just for clarification and enhancements. Does Like the Error with I want a method to return Mozilla Firefox or firefox.exe (container in which its running) or something like that. Maybe the method exists, I'm unaware of it. Also the docs didn't provided any help either, there are just bunch of methods name, we should be documenting them properly, what they returns or what they do along with some code examples. |
Hi again! I will try to clarify and summarize. PYWINCTL:
But ONLY IF the desktop/window manager is EWMH-compliant (e.g. GNOME, Cinnamon, KDE, awesome, ...). PyWinCtl will not work with non-EWMH environments (e.g. DWM, Wayland, ...) PYMONCTL
In short, you can use PyWinCtl to get the active app name, but not together with DWM. I hope this helps to clarify. |
Thanks for the clarification. I'm now working on mint in virtual box and was asking a general question about getting app name. It was my bad for not understanding the method naming convention. Again thanks for the clarification. 😶🌫️ |
No worries at all! Happy to hear this has been helpful. Thank you so much for your feedback. As you suggested, I have improved the module documentation (again, it will be available in next version). Just let me know if you need anything else, you find any other issue or you have any suggestion! |
Currently, I'm playing with this wonderful cross-platform library to track my application usage across systems and encountered the errors on the way described below:
test_pywinctl.py
under test directory on Linux Mint with Python 3.10. Works fine in window 10 under virtualbox.DeprecationWarning: getAllScreens() is deprecated. Use getAllMonitorsDict() from PyMonCtl module instead monitors = pywinctl.getAllScreens()
Following the warning, refactored the code to use
pymonctl.getAllMonitorsDict()
and got this error,From what I've read in the pymonctl README.md, properties may be None if can't be read/obtained. Also the key thing to note is that it doesn't work on Linux Mint with XLib installed
I'm using dual monitor and managing them using ARandR — Screen Layout Editor for Linux.
The text was updated successfully, but these errors were encountered: