timekpr does not lock screen on Xubuntu 20.04 (xfce4-screensaver)

Asked by Robert Euhus

Xubuntu 20.04 uses the LightDM display manager but has switched to using the xfce4-screensaver instead of light-locker.

I want timekpr to lock the user session instead of terminating it, to prevent the loss of data.

As far as I understand timekpr sends the lock-the-screen signal to or via loginctl, but xfce4-screensaver seems not to listen to the right dbus channel or so. I can lock the screen with xfce4-screensaver using the session dbus and sending org.xfce.ScreenSaver.Lock as documented here: https://docs.xfce.org/apps/xfce4-screensaver/dbus

If I purge xfce4-screensaver and switch back to light-locker the locking works as expected.

Since I would prefer to keep the Xubuntu default xfce4-screensaver, I would like to know, what needs to be done to make this work.

Thank You very much for keeping timekpr-next alive, even though You personally don't need it anymore!

One more thing: I have just completed the German translation. Do I need to do anything else, or will You just include that in an upcomming release?

Regards,
Robert

Question information

Language:
English Edit question
Status:
Answered
For:
Timekpr-nExT Edit question
Assignee:
Eduards Bezverhijs Edit question
Last query:
Last reply:
Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#1

I have to look into xfce screensaver, is it even compatible to gnome / kde one and whether it works, if it works in completely different way, then I have to look is it feasible to even add support for it, otherwise it will be ok.
I have a suspicion that when I was developing timekpr-next, it did not work or was incompatible.

I'll look into this when I'll have some free moments and I really hope that 20.04 livecd is fully functional to test this :)

As for translations, I usually import them when I release a new version, so if there will be a new version, I'll definitely will include the translations. At this moment only German is complete, so not a big work for me :)

Revision history for this message
Eduards Bezverhijs (mjasnik) said (last edit ):
#2

I took a look at the issue, it appears that locking the screen in XFCE4 is not fully implemented.

If you execute lock screen in session, that is from the user context, it works, if I try to lock the screen using login manager (in system bus), it does not. This explains why locking the screen in timekpr does not work, because it is the manager which controls the locking action, not the client.

Can you please verify that you can lock the screen using manager (which resides on the system bus)?

Revision history for this message
Eduards Bezverhijs (mjasnik) said (last edit ):
#3

What do I mean by that:
sudo dbus-send --system --dest=org.freedesktop.login1 --type=method_call --print-reply --reply-timeout=20000 /org/freedesktop/login1/session/_32 org.freedesktop.login1.Session.Lock
(please replace session id "_32" with correct one, you can find it using: loginctl list-sessions (first column))

Works perfectly in KDE Plasma 5.23, Manjaro Gnome 40.1, Ubuntu 18.04 Gnome, Ubuntu 20.04 Gnome, but it does not however in Ubuntu 20.04 XFCE...

Which is sad and it explains why locking is not working for you... I have already built-in a locking support for xfce for long time already with the hope that this will be fixed some day, but currently there is not much I can do.

Revision history for this message
Eduards Bezverhijs (mjasnik) said (last edit ):
#4

There will be a code fix soon (unrelated to this topic), however I'll include latest German translation too.
At first there will be a beta release and after some time, it will be released to stable.

Revision history for this message
Deák György (gydeak) said :
#5

Timekpr-nExT doesn't lock screen on Linux Mint 20.3 Cinnamon. Cinnamon version 5.2.7, kernel 5.4.0-110. I get notification: Your time is up, your session will be forcibly locked in 0 seconds, but nothing happens.

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#6

Can you please try this:

sudo dbus-send --system --dest=org.freedesktop.login1 --type=method_call --print-reply --reply-timeout=20000 /org/freedesktop/login1/session/_32 org.freedesktop.login1.Session.Lock

(please replace session id "_32" with correct one, you can find it using: loginctl list-sessions (first column))

?

Revision history for this message
Deák György (gydeak) said :
#7

sudo dbus-send --system --dest=org.freedesktop.login1 --type=method_call
--print-reply --reply-timeout=20000 /org/freedesktop/login1/session/c2
org.freedesktop.login1.Session.Lock
[sudo] apa jelszava:
method return time=1652889326.704695 sender=:1.12 -> destination=:1.413
serial=56519 reply_serial=2

Eduards Bezverhijs <email address hidden> ezt írta
(időpont: 2022. máj. 18., Sze, 15:16):

> Question #700420 on Timekpr-nExT changed:
> https://answers.launchpad.net/timekpr-next/+question/700420
>
> Eduards Bezverhijs requested more information:
> Can you please try this:
>
> sudo dbus-send --system --dest=org.freedesktop.login1 --type=method_call
> --print-reply --reply-timeout=20000 /org/freedesktop/login1/session/_32
> org.freedesktop.login1.Session.Lock
>
> (please replace session id "_32" with correct one, you can find it
> using: loginctl list-sessions (first column))
>
> ?
>
> --
> You received this question notification because you are subscribed to
> the question.
>

Revision history for this message
Eduards Bezverhijs (mjasnik) said :
#8

Did it lock the screen on real installation? I have tested that in LiveCD and it does not work for me.

Basically this is the analog of how timekpr-next locks the session, if it does not work on actual installation, then you're out of luck until this is fixed / implemented in Linux Mint Cinnamon edition.

Revision history for this message
Wolfgang (seewolf20) said :
#9

I have been a happy user of timekpr-next for a few years - thanks for maintaining this valuable product. I implementted it on my children's computers using Zorin OS 15.x Lite. Since they were not just playing with it, but also doing work for school, I used the lock option to stop them from using the device, so that unsaved data wouldn't get lost.
Recently, I upgraded all computers to Zorin OS 16.3 Lite. Unfortunately, I encountered the exact problem described in this thread. After reading the above and some other input from elsewhere, I compared the two installations Zorin OS 15.3 Lite and Zorin OS 16.3 Lite. Both are using the xfce4-screensaver, but different versions of course:

15.3: xfce4-screensaver/bionic,now 0.1.8-1~18.04 amd64
16.3: xfce4-screensaver/focal,now 4.16.0-1~20.04 amd64

The above mentioned dbus command works on 15.3, but it doesn't on 16.3.
I found a thread in the xfce forum (https://forum.xfce.org/viewtopic.php?id=16832) that suggests the usage of xflock4 or xfce4-screensaver-command --lock
I don't know what that involves on the developer's side.

Another tread talks about a patch, which (I think) has not been implemented in the package, yet (https://gitlab.xfce.org/xfce/xfce4-power-manager/-/issues/142#note_34631). The reason for the problematic behaviour is supposingly "org.freedesktop.ScreenSaver dbus interface does not contain a Lock() method" - I am just wondering, why it works with version 0.1.8 of xfce4-screensaver

My kids also discovered another issue with the dbus command for locking the screen. Whenever they click on any taskbar tool, the lock command will protract the lock screen until the mouse pointer hits something else with a click. This way, they could start a video and watch forever. I had to work around this by "making" the browser and video player a game.

I also tested light-locker instead of xfce4-screensaver. The lock via dbus works, but some features are missing, of course. Also, the issue with the click on the taskbar remains.

Can you help with this problem?

Provide an answer of your own, or ask Robert Euhus for more information if necessary.

To post a message you must log in.