Created
June 12, 2022 14:29
-
-
Save ooonea/ff54c7b51755858560efe08e688af77e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
revert() { | |
xset dpms 0 0 0 | |
} | |
trap revert HUP INT TERM | |
xset +dpms dpms 5 5 5 | |
i3lock -n | |
revert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice little wrapper script!
line 2-4 -
revert()
function, which sets all DPMS (Display Power Management System) functions to OFFline 5 - if the program is interrupted (e.g., by
kill
, or by the terminal it is running in dying (HUP (Hang Up)) call therevert()
functionline 6 - turns on DPMS to suspend, standby, and power to all trigger at 5 minutes
line 7 - runs the i3lock screen locker
line 8 - when i3lock has exited (e.g., someone entered the password) run
revert
to disable DPMS (so the screen never turns off or standby or suspends while you are working)