Page 1 of 1

lock screen automatically after time of idle

Posted: Thu Dec 22, 2022 1:49 pm
by marco556
I love LXDE but I don't want to use xscreensaver. A simple script should be enough:

Code: Select all

#!/bin/bash
while [ $(xprintidle) -le 6000 ]
do
	#nothing, just wait
done
/usr/bin/dm-tool lock
But: The problem is, how to restart it automatically, after unlocking?

Can an event be triggered, similar to autostart after login? Or is there a way to find out if the screen is locked or not?
Thanks

Re: lock screen automatically after time of idle

Posted: Fri Dec 30, 2022 1:18 pm
by marco556
push!

Re: lock screen automatically after time of idle

Posted: Mon Apr 24, 2023 9:43 am
by nutterbutternut
Reset to defaults
soccer random

Re: lock screen automatically after time of idle

Posted: Mon May 15, 2023 4:29 am
by lilycollins34
marco556 wrote: Thu Dec 22, 2022 1:49 pm I love LXDE but I don't want to use xscreensaver. A simple script should be enough:

Code: Select all

#!/bin/bash
while [ $(xprintidle) -le 6000 ]
do
	#nothing, just wait
done
/usr/bin/dm-tool [url=https://bitlifeonline.com/]bitlife[/url] lock
But: The problem is, how to restart it automatically, after unlocking?

Can an event be triggered, similar to autostart after login? Or is there a way to find out if the screen is locked or not?
Thanks
To automatically restart the script after unlocking the screen in LXDE, you can make use of the xscreensaver events and create a script that listens for the "Unblank" event.

Re: lock screen automatically after time of idle

Posted: Thu Oct 05, 2023 8:32 am
by kleasywe

Code: Select all

#!/bin/bash
while [ $(xprintidle) -le 6000 ]
do
	#nothing, just wait

done
/usr/bin/dm-tool lock
I still can't understand this codedrift boss