Bug 224450 - DBus signals on going to lock screen, suspend, hibernate and wake up
Summary: DBus signals on going to lock screen, suspend, hibernate and wake up
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (show other bugs)
Version: 5.27.5
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 436600 (view as bug list)
Depends on: 116304
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-27 11:43 UTC by Pavel Baranchikov
Modified: 2023-05-17 17:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Baranchikov 2010-01-27 11:43:11 UTC
Version:            (using KDE 4.3.4)
OS:                Linux
Installed from:    openSUSE RPMs

This would be nice to have such signals from DBus to integrate some applications' behavior with KDE.
Comment 1 Lamarque V. Souza 2011-04-09 08:24:47 UTC
That is already possible for wake up (resuming):

QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.connect("org.kde.Solid.PowerManagement", "/org/kde/Solid/PowerManagement", "org.kde.Solid.PowerManagement", "resumingFromSuspend", this, SLOT(slotResuming()));

Now we need to implement the others.
Comment 2 Nate Graham 2020-09-29 22:16:16 UTC
Are they still missing, or have they since been added?
Comment 3 Bug Janitor Service 2020-10-14 04:33:21 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Lamarque V. Souza 2020-10-14 13:39:52 UTC
(In reply to Nate Graham from comment #2)
> Are they still missing, or have they since been added?

Most of them are still missing. Only PrepareForSleep is available now through login1 dbus interface (resumingFromSuspend from Solid's Powermanagement interface has been removed):

qdbus --system  org.freedesktop.login1 /org/freedesktop/login1 | grep signal
signal void org.freedesktop.DBus.Properties.PropertiesChanged(QString interface, QVariantMap changed_properties, QStringList invalidated_properties)
signal void org.freedesktop.login1.Manager.PrepareForShutdown(bool)
signal void org.freedesktop.login1.Manager.PrepareForSleep(bool)
signal void org.freedesktop.login1.Manager.SeatNew(QString, QDBusObjectPath)
signal void org.freedesktop.login1.Manager.SeatRemoved(QString, QDBusObjectPath)
signal void org.freedesktop.login1.Manager.SessionNew(QString, QDBusObjectPath)
signal void org.freedesktop.login1.Manager.SessionRemoved(QString, QDBusObjectPath)
signal void org.freedesktop.login1.Manager.UserNew(uint, QDBusObjectPath)
signal void org.freedesktop.login1.Manager.UserRemoved(uint, QDBusObjectPath)

I guess PrepareForSleep can be used for both hibernate (suspend to disk) and sleep (suspend to ram). I do not see how a signal for lock screen can be usefull. A signal for wake up (resuming from suspend) is usefull to overcome some gpu problems, though usually you need to run the commands for that as root. I usually use the directory /etc/pm/ from pm-utils to run scripts just before sleeping and after wake up. That is not exactly user friendly but works ok.
Comment 5 Nate Graham 2020-10-14 14:57:54 UTC
Thanks for updating. Re-opening.
Comment 6 Nate Graham 2023-05-17 17:32:56 UTC
*** Bug 436600 has been marked as a duplicate of this bug. ***