[kde-linux] Howto issue commands on locking an unlocking the session

Nico Gulden cilugnedon at gmx.de
Sat Nov 3 12:31:29 UTC 2007


Hi Kevin,

Kevin Krammer schrieb:
> Hi Nico,
> 
> On Wednesday 31 October 2007, Nico Gulden wrote:
> 
>> I was inspired by the behavior kopete is showing on locking the session
>> manually (e.g. turning on the screensaver with a black screen) and
>> automatically setting the away status of my instant messenger. For
>> Jabber I'd like to use a different client (gajim) that is not as
>> integrated in kde as kopete is. The client provides a dbus interface and
>> I'm able to change the status issuing some commands.
>>
>> How can I use the kde infrastructure to easily issue the appropriate
>> commands on locking and unlocking the screensaver? I preferably use the
>> facility kde provides for locking the session. Are there any events I
>> can hook upon? Any hints to the documentation for reading or ideas how
>> to implement it would help me.
> 
> I think KDE calls the kdesktop_lock helper tools when it wants to lock the 
> session, so you could rename this utility and create a script with the 
> original name that does your additional commands and the calls the renamed 
> tool.
> 
> Not sure about the unlocking, my guess is that kdesktop_lock blocks (does not 
> return) until the unlock, so the script might be able to handle the 
> additional unlocking operations afterwards as well.

Thanks for the tip. I tried it out yesterday and it works as expected.
Your guess is right that kdesktop_lock blocks. Therefore in my wrapper
script it is doing somethin before calling the real kdesktop_lock and it
is doing something after kdesktop_lock. It is important that the wrapper
script passes the options on to the the real kdesktop_lock program.

Greetings, Nico.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cilugnedon.vcf
Type: text/x-vcard
Size: 119 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-linux/attachments/20071103/2f52c53a/attachment.vcf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-linux/attachments/20071103/2f52c53a/attachment.sig>


More information about the kde-linux mailing list