Skip to content

inhibit/dbus.c: use org.freedesktop.login1 (provided by systemd/elogind)

The inhibit/dbus.c code currently supports the following APIs:

static const char dbus_service[][40] =
{
    [FDO_SS] = "org.freedesktop.ScreenSaver",
    [FDO_PM] = "org.freedesktop.PowerManagement.Inhibit",
    [MATE]   = "org.mate.SessionManager",
    [GNOME]  = "org.gnome.SessionManager",
};

At least the org.freedesktop.PowerManagement.Inhibit spec of these is obsolete, as noted here:

https://www.freedesktop.org/wiki/Specifications/power-management-spec/

The modern API seems to be the Inhibit method of org.freedesktop.login1 (provided by systemd/elogind):

https://www.freedesktop.org/wiki/Software/systemd/inhibit/

It would be great if this was supported too.

My use case is probably a bit obscure, but I'll describe it anyway. Running VLC on a Linux phone with the Gnome-based Phosh interface, which does not provide org.gnome.SessionManager. Inhibiting org.freedesktop.login1 there would prevent suspending the phone when VLC is playing music / podcasts.

Edited by Oliver Smith
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information