Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to do: (lock -> blank screen -> turn off screen -> wait for two hours -> suspend device) #170

Open
zefr0x opened this issue Apr 13, 2023 · 4 comments

Comments

@zefr0x
Copy link

zefr0x commented Apr 13, 2023

I'm trying to do this:

flowchart TD
    A(Lock Activated) --> B[Show Blank Screen]
    B --> C{Wait for 10s}
    C --> |Activity| D[Prompt to Unlock]
    C --> |No Activity| E[Turn off Screen]
    E --> F{Wait for 2h}
    F --> |Activity| GA[Stop Timer]
    F --> |No Activity| H[Suspend Device]
    H --> |Turn on Device| D

    GA --> GB[Turn on Screen]
    GB --> D
Loading

My config: scripts/lock.sh

My screen saver script: scripts/saver_sleep_after_time

My xss-lock launch: .config/i3/config


What I concluded is happening with me is that as soon as XSECURELOCK_BLANK_TIMEOUT ends my screen will be turned off, but also the saver_sleep_after_time script will stop working, and the 2h timer for suspending will not work.

If I disabled XSECURELOCK_BLANK_TIMEOUT my screen will be always working which is a problem too.

Is there any solution for that?

@akino512
Copy link

I don't know how to set suspend, but you can try the following to set locks and the screen turn off.
A simple style may be like this:

xset dpms 0 0 60  // wait 60s to turn off screen
xset s 30 // wait 30s to lock device
xss-lock -l -- xsecurelock &

@zefr0x
Copy link
Author

zefr0x commented May 28, 2023

I don't have problems with this part.

xset dpms 0 0 60 // wait 60s to turn off screen

I'm already using this to trigger xss-lock.

xset s 30 // wait 30s to lock device

This will just dim my screen using /usr/lib/xsecurelock/dimmer preparing to it's lock, xsecurelock will handle things aftart that.


My problem is with xsecurelock's screen saver part. After locking the screen it should start working as a timer to suspend my device after some time, and be killed with any activity (e.g. keyboard clicked, mouse moved).

But what is happening with me is that xsecurelock's screen saver will not work directly when my screen is locked, it will only work if I did an activity after locking my screen (without unlocking it) then keep it idle again.

I want xsecurelock's screen saver to work directly after locking my screen.

@useredsa
Copy link

The second exec of saver_sleep_after_time is not going to get executed because the shell will get replace with the sleep command.

I would also be interested in this state diagram.

@akino512
Copy link

@zefr0x
Keep "xss-lock" running and run "xautolock". like this:

xss-lock -l -- env XSECURELOCK_BLANK_TIMEOUT=10 xsecurelock
xautolock -time 60 -locker "systemctl suspend" -detectsleep

(xautolock seems to have a timer limit of up to 1 hour)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants