You are not logged in.

#1 2025-09-10 14:26:56

ironhak
Member
Registered: 2025-08-10
Posts: 71

[SOLVED] With a window manager how to manage lockscreen and suspend???

Hello

I'm using i3wm and thus far here's what I'm doing:
```
set $i3lockwall betterlockscreen --off 600 -l
exec xset s 180
exec xss-lock -- $i3lockwall
```

That way after 180 seconds of inactivity the computer will go in lock screen. But there are some problems:
1. I would like to have a way to automatically suspend the pc after n. minutes of inactivity inside lock screen
2. I would like to have a way to inhibit xset, something like an app called "caffeine" (which does not work)

I tried using xfce power manager, and I can obtain point 2 thanks to "Presentation mode", but suspend wont. If I set on power manger "sleep after 2 mintues" then after two minutes I get a pop-up telling me that "None of the lock scree tools run successfully", but if I press "Yes" then the pc will suspend corectly...

I was wondering if there's a better seamless way to manage lockscreen and automatic sleep.
Thanks

Last edited by ironhak (2025-10-18 07:43:35)

Offline

#2 2025-09-10 15:09:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,162

Re: [SOLVED] With a window manager how to manage lockscreen and suspend???

"xset s 0"
https://github.com/betterlockscreen/bet … lockscreen is just a shell script, you could

…
(sleep $((n*60)) && systemctl suspend) &
SUS_JOB=$!
[[ $runlock ]] && lockinit "$lockstyle"
kill $SUS_JOB
…

resp. leverage ~/.config/betterlockscreen/custom-{pre,post}.sh for that (you'll have to store the pid of the delayed suspend process in some tmpfile here)

Offline

#3 2025-09-10 16:10:59

ironhak
Member
Registered: 2025-08-10
Posts: 71

Re: [SOLVED] With a window manager how to manage lockscreen and suspend???

Thanks  but isn't there something like xfce power manager where I can have every setting inside a single UI program?
Thanks

Offline

#4 2025-09-10 19:01:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,162

Re: [SOLVED] With a window manager how to manage lockscreen and suspend???

Yes: xfce power manager.

If you want to approach this w/ the screensaver timeout and betterlockscreen you'll have adjust betterlockscreen to conditionally suspend the system.
If you want to have something where a custom screenlocker is already integrated w/ a custom power manager and a custom UI, you want to have a desktop system.

There's also stuff like xautolock which you can run multiple instances of that will do random things after different times of inactivity.
https://wiki.archlinux.org/title/Session_lock#xautolock

Offline

#5 2025-09-12 10:11:00

ironhak
Member
Registered: 2025-08-10
Posts: 71

Re: [SOLVED] With a window manager how to manage lockscreen and suspend???

Hello, thanks.

I solved my issue by disabling "Lock screen when system is going to sleep" on xfce power manager. That way I don't get the pop-up telling me that xfce couldn not find the screen locker.

And the screen gets locked nonetheless because I run:

exec xss-lock -- betterlockscreen -l

at session startup.

Thanks smile

Last edited by ironhak (2025-09-12 10:11:55)

Offline

#6 2025-09-12 13:31:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,162

Re: [SOLVED] With a window manager how to manage lockscreen and suspend???

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB