jnerin / dbus-listen-inhibit

Tool to check for dbus messages inhibiting sleep in power management
GNU General Public License v2.0
5 stars 0 forks source link

manual dbus instruction's don't work anymore? #2

Open marcmerlin opened 2 years ago

marcmerlin commented 2 years ago
sauron:~$ dbus-monitor --session interface=org.freedesktop.PowerManagement.Inhibit.
dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.MatchRuleInvalid: "Interface name 'org.freedesktop.PowerManagement.Inhibit.' is invalid
". Falling back to eavesdropping.
Failed to setup match "eavesdrop=true,interface=org.freedesktop.PowerManagement.Inhibit.": Interface name 'org.freedesktop.PowerManagement.Inhibit.' is invalid

sauron:~$ qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.Inhibit.Inhibit "$$" "Testing D-Bus Interface" qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.Inhibit.Inhibit "$$" "Testing D-Bus Interface" 404
qdbus: could not find a Qt installation of ''
jnerin commented 2 years ago

Hi @marcmerlin , a lot has changed since 2014, I suggest you to read the systemd's take over of inhibit handling, but before you start coding look at the manpage of systemd-inhibit(1) instead.

NickLeippe commented 2 years ago

Not everyone uses systemd.

jnerin commented 2 years ago

Not everyone uses systemd.

I know, but sadly the hostile take over of responsibilities by systemd causes the drop of support for the previous alternatives and they become stale and buggy over time. I know that Gnome has its own inhibit API too that is mentioned at the bottom of the https://www.freedesktop.org/wiki/Software/systemd/inhibit/ page I linked before, the equivalent set of instructions would be https://sleeplessbeastie.eu/2022/01/31/how-to-identify-a-gnome-application-that-acquired-an-inhibitor-lock/ and for KDE it appears someone developed a plasma applet https://store.kde.org/p/1426768

marcmerlin commented 1 year ago

Thanks @jnerin , don't love it, but I have systemd.

marcmerlin commented 1 year ago

By the way systemd-inhibit(1) does the opposite of what I need. It prevents going to sleep, when I already have programs like chrome that do that against my will, and my laptop will never go to idle and start screensaver anymore :(

jnerin commented 1 year ago

systemd-inhibit --list

   --list
       Lists all active inhibition locks instead of acquiring one.