$ws = New-Object -COM wscript.shell;
while($true){ $ws.SendKeys("j"); Sleep 60;}
Ive used it for demos that way the computer doesnt lock before the demo starts, its pretty short and easy to remember. Also on windows if you spam SendKeys("{Left}") everything you type is backwards and when you hit the windows key it freezes the computer in an interesting way, pretty fun.
function mouse_around {
while true; do
sleep "$1"
xdotool mousemove_relative 1 1
xdotool mousemove_relative -- -1 -1
done
}
mouse_around 60Use it all the time when working from home/moving around and I don’t want my laptop to lock every 15.
Or a powered turntable for your mouse, if you can't plug HID devices into your machine! https://www.amazon.com/Liberty-Mouse-Mover/dp/B079P592K8/
We used one of the common Raspberry PI Human Interface Device (HID) Python packages to send a harmless keyboard or mouse event once every 5 minutes.
https://www.schneier.com/blog/archives/2009/08/risk_intuitio...
This worked great, except if we wanted to work over the weekend, since if we left the screen alone for more than a few minutes, the screen lock would kick in and we'd lose the session.
Our solution? We purchased a small fan with an oscillation mode, and tied a mouse to it. We then had the fan drag the mouse ever so slightly back and forth whenever we wanted to step away from the remote session. Kept it going for weeks.