6
3
I use pam_usb and want to lock/unlock computer when USB stick is removed/inserted. For locking I use qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
and it works perfectly. For unlocking I've tried a series of commands I've found (most of them are aggregated here), but they don't work. Specifically, if we exclude those with KDE 4 syntax, they fall into 2 categories: those using qdbus (relevant path here, several variations exists) /MainApplication quit
which hang my Xorg completely, and those using killall
against screenlocker process, but the process just restarts instantly after that!
So, my question is: how to unlock KDE5 screen locked with its standard locker programmatically?
I want to do the same thing but using BlueProximity {at 1.2.5 at present on my system - Debian Old-stable (Wheezy)} - the above, written more fully as
– SlySven – 2016-04-02T21:24:36.147qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock
does activate the screensaver in "locked" mode {you can replace the last fragment withorg.freedesktop.ScreenSaver.SetActive
true
to put up the saver without a lock} and in either case you may get the screen back with that latter withfalse
- but the monitor (not the whole screen as I have two monitor in one virtual...... screen) is unresponsive to keystrokes or mouse clicks - the other monitor behaves normally and so do windows on the "inactive" once I have <alt>-<tab>bed to them from the working window and then used <alt><F3> (window operations) to move them with the arrow keys to the working window. I use KDE and have extra widgets showing on the saver screen (a clock and a CPUs activity monitor - for those long build jobs) and they and the "unlock/switch user" widget also remain. Normality is restored by entering the password in the dialog from the "unlock". I, too, need a command to unlock properly. – SlySven – 2016-04-02T21:32:59.603
after a bit of experimenting - Ah, I'm on KDE4 not 5 so my:
kill \
ps ax | grep "kscreenlocker" | grep -v grep | cut -d" " -f 1`` is not going to be much help to you though it works in my particular case... – SlySven – 2016-04-02T22:34:38.280Thank you for sharing an experience! But, unfortunately,
qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive false
doesn't unlock screen on my Arch Linux with KDE PLasma 5.6.1 – Ruslan Prokopchuk – 2016-04-03T05:50:26.600It doesn't for me either! That only kills the screeen saver if it has been activated with the
... org.freedesktop.SetActive true
(i.e. in "saver" mode) rather than via... org.freedesktop.Lock
(i.e. in "lock" mode). That is why I had to resort to usingkill
on anykscreenlocker
processes running under my UID. kscreenlocker is what runs the selected screensaver(s) at least in my setup, however YMMV. – SlySven – 2016-04-03T22:12:26.747