Created
April 30, 2020 10:32
-
-
Save turingbirds/1f184cbe7228e80dec761a015dacdc66 to your computer and use it in GitHub Desktop.
Manually launch xscreensaver; disable auto-activate
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/bash | |
# I do not want my screensaver to auto-activate after a timeout. | |
# For some reason, you *have* to select a nonzero, finite timeout value for xscreensaver (there's no "infinity"). | |
# I only want my screensaver to active when I lock my system by pressing [Meta]+[L]. | |
# This hotkey is set up to launch this script, which | |
# - starts the xscreensaver daemon, | |
# - activates the screensaver (with lockscreen enabled), | |
# - waits for it to terminate (unlocking logs an "UNBLANK" event), | |
# - then kills the xscreensaver daemon. | |
xscreensaver -no-splash & | |
sleep .1 | |
xscreensaver-command -activate & | |
sleep .1 | |
xscreensaver-command -watch | { grep -m 1 UNBLANK && killall xscreensaver-co ; } | |
pkill xscreensaver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment