5 ms·
Implementation for Linux: #!/bin/bash set -e while true; do sleep 20m xlock -allowaccess& pid=$! sleep 20s
by anon4 12y ago
Implementation for Linux:
#!/bin/bash
set -e
while true; do
sleep 20m
xlock -allowaccess&
pid=$!
sleep 20s
kill $pid
done
Check the manpage for xlock and choose a screensaver that won't keep you looking at the monitor.
- butwhy 12y agoExplanation? DOes it just lock the screen for 20 secs?
- ssharp 12y agoI accidentally did something similar quite a few years ago when I stupidly set up a grep to run updatedb every two hours. There was several months lag as well between when I did that and my computer started locking up every two hours for a few minutes. And embarrassingly, it took me a week or two to put it together.
- ssharp 12y ago*stupidly set up a cron
- darkr 12y agoIf you're using Xscreensaver instead of xlock: #!/usr/bin/env bash set -e while true; do sleep 20m xscreensaver-command -activate sleep 20s xscreensaver-command -deactivate done This presumes that xscreensaver is configured to have a delay before it is locked (and thus requiring a password to unlock - as would happen if we used `xscreensaver-command -lock`).