#!/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`).
I 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.
On the topic of eye strain. For anyone not familiar with f.lux, highly recommend you check it out. Everyone that I have recommended it to so far loves it. https://justgetflux.com
The only problem with f.lux is that it's so seamless it's like it's not running, so occasionally I'll turn it off accidentally and it feels like looking into the heart of a supernova.
My eye strain ended permanently about 4 years ago, the day I installed f.lux. My eyes have never once felt strained at night after that day. Truly a miracle program.
- every now and then I'll edit a photo, upload it somewhere, and then get very confused about why it looks so weird when showing it to somebody on my phone -- it would be great if f.lux shut off when certain user-configurable applications are in focus
Is anyhthing known about the internals of it, i.e. what code does it use? Something like SetDeviceGammaRamp on Windows? Or does it talk directly to the video card driver (if that is even possible in a generic way)? Or the monitor? Does it still work reasonably if I already have set my display to low brightness etc?
edit also wondering: it cannot know if I'm sitting in a completely dark room, a sunlit room or a room at night with fluorescent lighting. Don't such factors change what the ideal color would be? (not that I am constantly adjusting my display now according to the amount of clouds outside, just wondering what it does exactly. There's like no info whatsoever?)
I've found f.lux indispensable for long hours of computer work, be it coding or reading. Surprised when I find friends who haven't installed it (or an alternative) yet -- this stuff should be standard, especially on incredibly bright-screen Macs. If you're on Linux, try Redshift instead.
When will something like this be available on my non-jailbroken iPhone? Heck, maybe someone could make a third-party browser app that tints itself ... turning down the brightness is just not the same.
Surprised when I find friends who haven't installed it (or an alternative) yet
And here, I am ridiculed for using Flux. Some marketing people just hate it. One co-worker has me disabling it anytime he has to look at my monitor (not much, but still an annoyance!)
I have experienced that eyes strain much lesser while using a LCD display instead of an LED display. Experienced this pretty much consistently. LEDs start hurting my eyes after some time.
And I use a MBP with Retina display for long hours - and I have to say, it has never put stress on my eyes at all (unless I make the screen too bright). Also I do not work at super-high small font resolutions - that allows me to keep distance from the screen. The only thing that I find better than it is Kindle reader.
Do you mean a LCD display with fluorescent tube as light source, instead of an LCD display with an LED as light source?
Your MacBookPro with Retina display uses an LCD with LED light source too - it's just an LCD panel with IPS technology instead of the TN technology (common in cheaper desktop monitor panels).
Has the 20-20-20 rule actually been scientifically verified as the optimal regime for relieving eye strain or was it something thought up by some bloke off the top of his head?
I wasn't able to find any conclusive evidence, but there are studies that have shown that taking breaks and changing the distance of what you're focusing on (things that the 20-20-20 rule suggests to do) can help improve eye strain. One study: http://www.ajronline.org/doi/pdf/10.2214/ajr.184.2.01840681
From practical experience, the break in the flow is minimal: you lose your immediate context, not the entire structure you've built up in your mind. And the loss of context isn't always bad, as it's helped me figure out small problems or identify potential problems which I normally miss from being constantly heads down.
I've been trying this concept for a few days and it's not that bad. It just forces me to stop typing and looking at my screen, not stop thinking or working on my problem, so it doesn't really affect my flow or concentration. It's actually kind of helpful to have to stop and think about what I'm doing.
I actually use a similar thing - I run a script that locks the screen every 30 minutes and take a short break. At first it can be a bit annoying, but it does reduce eye strain and improves overall well-being.
I use RSIGuard (Mac), not for eye strain but for muscle pain in my forearms. I've set it up to give micro breaks (10 seconds) every 5 minutes and exercise breaks (4 minutes) every 45 minutes. It does break the flow, which is a bit of a pain, but not as much of a pain as I had in my arms :-)
Having pain in your wrists and fingers so you can't type, and not having the ability to focus on the screen, those things are very annoying for developers.
I have RSI and use Workrave to force me to take a 30 second break (where I stand up and stretch etc usually) every 10 minutes and a 5 minute break every hour of typing (which, since software development is a lot of discussing and thinking as well as just typing, doesn't usually mean it comes up every hour).
You get used to it, and I honestly don't think it disrupts any kind of flow. That cartoon is about disrupting you with some other information, not with a break.