You are not logged in.
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
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
Which version of xscreensaver?
Offline
xscreensaver version 6.07.
Offline
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
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
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.
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
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
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
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
Maybe it worked before because the lock function didn't report the success status correctly
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
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
Awesome, that worked. Thank you!
Offline
[ Generated in 0.011 seconds, 8 queries executed - Memory usage: 558.79 KiB (Peak: 575.63 KiB) ]