The officially official Devuan Forum!

You are not logged in.

#1 2022-02-13 02:58:54

zapper
Member
Registered: 2017-05-29
Posts: 969  

I am in need of a particular suspend+lock script

I have a way to deal with root problem aspect... aka doas...

But yeah,  I wondered if anyone knows how to make a python script that does something similar to the below:

I know how to do the first part, which is wait 30 minutes, then lock... xautolock + slock makes this possible... smile

The second part, I need help with however...

after it is locked, WARN for 30 minutes, then activate the part that suspends system...

This I have covered easily however...

Just part 2 eludes me at this time...

Btw, I want this to work with Hyperbola. smile

I hope that is okay...

Just to be clear, the 2nd part isn't an issue probably on Debian based distros anyhow, as far as I know. Just closing the lid seems to do that already.


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

#2 2022-02-13 04:37:33

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,259  

Re: I am in need of a particular suspend+lock script

You could maybe you use the -killtime and -killer

Though I'm not sure what "warn for 30 minutes" means; warn repeatedly for 30 minutes?

I suppose eg a 5 minute killer could check the time since slock start, and warn or eventually call pm-suspend?

Offline

#3 2022-02-14 04:00:19

zapper
Member
Registered: 2017-05-29
Posts: 969  

Re: I am in need of a particular suspend+lock script

ralph.ronnquist wrote:

You could maybe you use the -killtime and -killer

Though I'm not sure what "warn for 30 minutes" means; warn repeatedly for 30 minutes?

I suppose eg a 5 minute killer could check the time since slock start, and warn or eventually call pm-suspend?

Basically, after it is locked, it warns for 30 minutes, doesn't undo the lock and then goes back to waiting 30 minutes over and over again, kind of thing...

If its ever idle for longer than the duration, it suspends.  and if you bring it back, aka, take it out of suspend and unlock it,

then it repeats from step 1.

Btw, by warn, I mean the screen turns a specific color, or a warning message appears with a timer before it suspends.

Something like that.


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

Board footer