Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-09-09 17:34:53

mgwolf
Member
Registered: 2023-09-09
Posts: 7

[SOLVED] Suspend after inactivity fails due to screen lock error

Copying this here from https://gitlab.xfce.org/xfce/xfce4-powe … issues/142 as suggested by Gaël.

I would like my system to suspend after 15 minutes of inactivity. However, after 15 minutes of inactivity, I get an error message, "None of the screen lock tools ran successfully", and my system doesn't suspend.

Last edited by mgwolf (2023-09-10 05:52:17)

Offline

#2 2023-09-09 17:37:40

mgwolf
Member
Registered: 2023-09-09
Posts: 7

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Gaël wrote:

This is because we have removed the autostart launcher for xscreensaver in xfce4-session 4.19.1, you have to launch it yourself by some means at the beginning of the session (or your distribution has to add this launcher, or...).

I tried xfce4-session 4.19.1 and manually launched xscreensaver, but the problem remained the same, Power Manager could not lock the screen and thus it did not suspend. Downgrading back to 4.18.3 for now.

Last edited by mgwolf (2023-09-09 17:52:29)

Offline

#3 2023-09-09 17:40:32

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Which version of xscreensaver?

Offline

#4 2023-09-09 17:42:22

mgwolf
Member
Registered: 2023-09-09
Posts: 7

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

xscreensaver version 6.07.

Offline

#5 2023-09-09 17:55:04

Tamaranch
Member
Registered: 2020-12-31
Posts: 257

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Okay, let's set aside the case of xfce4-session 4.19.1 for now, we don't need it.
As for xfce4-power-manager, does it work with 4.18.2?
Do you have anything in ~/.xsession-errors when xfce4-power-manager fails to suspend?

Offline

#6 2023-09-09 18:32:59

mgwolf
Member
Registered: 2023-09-09
Posts: 7

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

No, it doesn't work with xfce4-power-manager 4.18.2 either. I believe the last version it worked on was 4.16.0.

I do not have an ~/.xsession-errors file at all.

Is there a way to reduce the suspend after inactivity period to less than 15 minutes? That's the minimum offered by the Power Manager UI, but it would be nice to set it to a lower value, to make testing quicker.

Offline

#7 2023-09-09 19:13:52

Tamaranch
Member
Registered: 2020-12-31
Posts: 257

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

mgwolf wrote:

I do not have an ~/.xsession-errors file at all.

Then in

journalctl -b

? Otherwise you can kill xfce4-power-manager and start it in a terminal so you can see its output.

mgwolf wrote:

Is there a way to reduce the suspend after inactivity period to less than 15 minutes? That's the minimum offered by the Power Manager UI, but it would be nice to set it to a lower value, to make testing quicker.

Yes, it's stupid... You can set any value other than 14 (which disables sleep mode) via the settings editor or the command line:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac -s 1

Offline

#8 2023-09-09 19:30:30

mgwolf
Member
Registered: 2023-09-09
Posts: 7

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Nothing in

journalctl -b

. xfce4-power-manager shows the following message in the terminal:

xscreensaver-command: already locked

Indeed, if my screen is not already locked (I have it set to auto lock after 10 minutes, so that is why it was always locked during my tests) when Power Manager tries to suspend, it works.

Thank you for the command for reducing the inactivity period, this makes testing much quicker!

Last edited by mgwolf (2023-09-09 19:31:08)

Offline

#9 2023-09-09 20:31:49

Tamaranch
Member
Registered: 2020-12-31
Posts: 257

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Ah ok, it's solved then?
I don't think there's a command to query xscreensaver status, that's what it would take to fix this.

Offline

#10 2023-09-09 20:37:38

mgwolf
Member
Registered: 2023-09-09
Posts: 7

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Well, I would like Power Manager to suspend on inactivity even if the screen is locked. This used to work in a previous version of Power Manager. Maybe some way to force suspend even if Power Manager isn’t sure the lock succeeded?

Offline

#11 2023-09-09 20:46:24

Tamaranch
Member
Registered: 2020-12-31
Posts: 257

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Maybe it worked before because the lock function didn't report the success status correctly smile
It looks like you can script something from `xscreensaver-command -time`, but I don't know if that's really reliable: https://unix.stackexchange.com/a/49226
Otherwise the easiest thing to do is:

xfconf-query -c xfce4-session -p /general/LockCommand -s "sh -c 'xscreensaver-command --lock || :'"

Obviously it won't bring up the other `xscreensaver-command --lock` errors anymore, but it's not sure there are many interesting ones.

Offline

#12 2023-09-09 21:26:47

Tamaranch
Member
Registered: 2020-12-31
Posts: 257

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

A little smarter command:

xfconf-query -c xfce4-session -p /general/LockCommand -s "sh -c 'xscreensaver-command --lock 2>&1 | grep -Eq \"locking|already locked\"'"

Last edited by Tamaranch (2023-09-09 21:27:56)

Offline

#13 2023-09-10 05:51:31

mgwolf
Member
Registered: 2023-09-09
Posts: 7

Re: [SOLVED] Suspend after inactivity fails due to screen lock error

Awesome, that worked. Thank you!

Offline

Board footer

Powered by FluxBB