The officially official Devuan Forum!

You are not logged in.

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

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

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.


Black Lives Matter!  I am white, but I prefer equality over hatred.
Haughtiness comes before a fall, pride before destruction.
Peace be with you!
No one can serve two masters. Either you will hate the one and love the other, or you will be devoted to the one and despise the other. You cannot serve both God and mammon!

Offline

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

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 689  

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: 432  

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.


Black Lives Matter!  I am white, but I prefer equality over hatred.
Haughtiness comes before a fall, pride before destruction.
Peace be with you!
No one can serve two masters. Either you will hate the one and love the other, or you will be devoted to the one and despise the other. You cannot serve both God and mammon!

Offline

Board footer