Skip to content
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

Clarify requirements for each method - systemd, dbus-send, dbus-daemon..? (linux) #33

Closed
fohrloop opened this issue Apr 11, 2023 · 2 comments

Comments

@fohrloop
Copy link
Owner

fohrloop commented Apr 11, 2023

There are multiple possible ways to set a keepawake / inhibitor on linux:

  1. Using D-Bus: Jeepney + org.freedesktop.ScreenSaver
  • Requires: jeepney python package, dbus-daemon running and DBUS_SESSION_BUS_ADDRESS available
  1. Using D-Bus: Calling dbus-send + org.freedesktop.ScreenSaver (?)
  • Requires dbus-send (+ probably a dbus-daemon running)
  1. Using systemd (systemctl mask)
  • This required sudo. Does it need dbus-daemon?
  1. Using dbus-python (with libdbus)
  • This requires: dbus-python (python package) and libdbus

These need clarification

Q1) If a system has dbus-daemon running, does it also can dbus-send executable available? Could dbus-send replace jeepney solution? Or can jeepney be used as dbus solution in a situation where dbus-send executable is not available?

Q2) If a system does have systemd (systemctl command) available, does it automatically mean that dbus is available? Could systemd solution be dropped in favor of a dbus solution? Does the systemctl command use dbus internally?

Q3) In which situations dbus-python would be needed? (Related: #32 )

Edit: Added dbus-python

@fohrloop
Copy link
Owner Author

fohrloop commented Apr 11, 2023

Starting from the very end: The current implementation calls Inhibit method of the org.freedesktop.ScreenSaver interface.

  • What are the minimum requirements to call it?
  • What are the requirements that org.freedesktop.ScreenSaver is available to be called?
  • What are the fallback(s) if that cannot be called?

At specifications.freedesktop.org it says that "org.freedesktop.ScreenSaver — The Idle Inhibition Service manages the inhibition requests". In what packet this service is installed and on what linux distributions it is available?

@fohrloop
Copy link
Owner Author

fohrloop commented Jun 4, 2023

Answers

Q1) dbus-send, in general case, cannot be used as solution. See #34 (comment) I have seen it used to take locks, though, so probably it depends on the D-Bus service version (flavor and version of Desktop Environment). Skipping dbus-send at least for now.

Q2) If there is systemd, there will be dbus available. Source: https://wiki.archlinux.org/title/D-Bus D-Bus seems to be very widely available in linux distributions. Could say that most of the Desktop Environments also provide some D-Bus interface which can be used for either "presentation mode" or "long task mode" purposes.

Q3) Not sure when dbus-python would really be needed. The 0.7.0 will depend on jeepney only, but I'm considering adding support for different dbus libraries later on, or then creation a small D-Bus (subset) implementation for just wakepy.

Q4) About org.freedesktop.ScreenSaver D-Bus interface. This is made available by the first program which announces it implements the interface. In most if not all cases, this will be the Desktop Environment used (GNOME, KDE, Xfce). I think I saw some desktop environments which did not implement this, and it is possible that sometimes the implementation has bugs, etc. (cannot think an example from the top of my head now, but I'm sure I saw some bug tickets related to the D-Bus interfaces of some DEs).

@fohrloop fohrloop closed this as completed Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant