Bug 199239 - Wishlist: Make screen lock cause auto logout.
Summary: Wishlist: Make screen lock cause auto logout.
Status: RESOLVED WORKSFORME
Alias: None
Product: kopete
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-07 08:03 UTC by JayD
Modified: 2009-07-27 04:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JayD 2009-07-07 08:03:40 UTC
Version:            (using KDE 4.2.3)
OS:                Linux
Installed from:    Ubuntu Packages

I use Kopete at home and a windows program at work.  When I go to work I need 
to remember to logout from my accounts on Kopete to make the transition 
smoother.  I expect I'm not the only one in this situation.

What would be nice is an option in Kopete to log me out of all accounts whenever
I lock the screen.  I am clearly not available when the screen is locked.  
"Away" is not good enough as I need to be really logged out.
Maybe you can detect the screensaver running or something and do the logout.
Automatically logging back in when I unlock the screen would also be a nice feature.
Comment 1 Daniel Eckl 2009-07-21 14:15:47 UTC
Perhaps this trick can help you, too.
https://bugs.kde.org/show_bug.cgi?id=162739#c2

You could replace the commands with
dbus-send --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.disconnectAll
and
dbus-send --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.connectAll
Comment 2 JayD 2009-07-27 03:59:05 UTC
Thank you Daniel for that excelent workaround.

I am running xfce so kscreenlocker is not running but xscreensaver is.  However it seems to be running constantly, so I can't play this trick with it.  When I lock the screen it runs xflock4, and I can play the trick with that and it works correctly to log me out, but since xflock4 returns immediately, it logs me back in immediately too.  So I commented out the second part and just let it log me out for now.  Hopefully I can discover something that runs when I unlock the screen so I can intercept that to log me back in.  I guess I'll have to ask over in the xfce forums.
Comment 3 JayD 2009-07-27 04:49:18 UTC
Upon further investigation I found the man page for xscreensaver-command and there is a script described there that is close, combined with these dbus commands I have a working solution.  It is not as clean in that I must have a shell script always running, but it works.

#!/bin/bash
xscreensaver-command -watch | while read cmd date ; do
    if ps aux | grep kopete > /dev/null 2>&1; then
        if [[ $cmd == "BLANK" || $cmd == "LOCK" ]] ; then
            dbus-send --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.disconnectAll
        fi
        if [[ $cmd == "UNBLANK" ]] ; then
            sleep 1
            dbus-send --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.connectAll
        fi
    fi
done

(note that there is no newline after "/Kopete"
Comment 4 JayD 2009-07-27 04:52:46 UTC
I marked this as resolved, but if the kopete team would be willing to add this functionality within the program itself, you can keep it on the wishlist.  :)