Created
May 15, 2016 19:16
-
-
Save afresh1/04fb7c7068b84fbf4dee8428a31f6846 to your computer and use it in GitHub Desktop.
Lock screen and dpms off monitor. I have `command lock "lock_screen"` in ~/.cwmrc and `*/5 * * * * $HOME/bin/monitors_off` in my crontab.
This file contains hidden or 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 | |
| if ! pgrep xlock >/dev/null 2>&1; then | |
| xlock -lockdelay 0 & | |
| sleep 1 | |
| fi | |
| sudo -k | |
| ssh-add -D | |
| ~/bin/monitors_off & |
This file contains hidden or 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 | |
| if pgrep xlock >/dev/null 2>&1; then | |
| DISPLAY=`pgrep -nfl '[ /]X :[0-9]+ vt05' | | |
| sed -e 's/^[^:]*\(:[0-9][0-9]*\)[^0-9].*/\1/'` | |
| if [ X"${DISPLAY}" != X"" ]; then | |
| xset -display ${DISPLAY} dpms force off | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment