This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to make some action on screen lock?

Tags: None
(comma "," separated)
User avatar
pavel
Registered Member
Posts
134
Karma
1
OS
I want to send DBus messages to some applications (Psi) by calling command-line commands on the following moments:
  • desktop lock (by hand or by idle time),
  • entering stand-by mode (suspend to ram),
  • entering hibernate mode (suspend to disk),
  • waking up from suspend.
How to create such triggers?


pavel, proud to be a member of KDE forums since 2008-Dec.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
PowerDevil appears to have some DBus signals which may be related.

qdbus org.kde.powerdevil /modules/powerdevil.

Note that wake up from suspend is likely to be unavailable in any case, since Plasma would update its clock on resume if this were possible.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
pavel
Registered Member
Posts
134
Karma
1
OS
bcooksley wrote:PowerDevil appears to have some DBus signals which may be related.


Does console version of qdbus work with signals? Or I can only call methods?

And... PowerDevil works only with laptops. The signal stateChange concerns to plugging notebook to electric socket or leaving it on battery.

But I need signals emitted on screen lock and suspending.


pavel, proud to be a member of KDE forums since 2008-Dec.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Unfortunate. I suggest you ask the PowerDevil maintainer to add the signals you need, or a capability to run scripts in the user environment before performing the task. This should be possible for all but resuming from suspend though.

The console version of QDBus cannot work with signals unfortunately.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]