wakepy
wakepy copied to clipboard
Method using gtk_application_inhibit()?
See: https://docs.gtk.org/gtk3/method.Application.inhibit.html
If I'm not mistaken, this requires PyGObject (which has import name gi
) . It could be used as an alternative "no dbus" option?
This is a particularly interesting option since so many Desktop Environments are based on the GTK graphical toolkit (GNOME, Xfce, Cinnamon, LXDE, MATE, Unity, Budgie, Pantheon), and because it offers a non-dbus alternative.
Alternatives
-
Make PyGObject (
gi
) a requirement for wakepy. This has the downside that (1) It's an additional dependency and (2) the PyGObject is not pure python package so it requires compiling tools to be available. -
~Do site-packages search for system python folder and add the
gi
package into the sys.path~ Use system python in separate process. I'm assuming thatgi
python package is available in all the desktop environments which use GTK. No additional dependencies would be needed for wakepy. In other words, thegi
python package would be treated as any non-python dependency; you search, and if you find, you can use. -
Interfacing
gtk_application_inhibit()
directly withoutgi
somehow. Does not require dependency but probably requires a lot of extra work. I assume that if a system has GTK, it has alsogi
python package available so this kind extension module is not required.
Tasks
- [x] Try out gtk_application_inhibit() with
gi
. Is it possible to prevent sleep and/or idle with it (to support both: keep.running and keep.presenting modes)? yes, it is. - [ ] Find a way to get the system site-packages location reliably