Some years ago, when I needed to re-check my eyeglasses’ prescription, I found an article on the Internet about an optician – I think in Los Angeles – who was making special glasses for computer users. (I can’t find that URL anymore, unfortunately.)
Aside: my personal case is rather uncommon. I’ve always been nearsighted in the left eye (-4 to -5 diopters), while my right eye was normal. The left eye also has a slightly different color response, seeing things a little greener and darker than the right. Until my late 30s, both eyes had an overlapping range where both would focus well… starting at 30cm out and going to about 90cm (1 to 3 feet if you’re stuck in the imperial backwaters). Then, presbyopia set in and astigmatism became worse; my eyes’ focusing ranges no longer overlap at all, so I started needing different eyeglasses to work and to drive. (I still need no glasses to read with the left eye, at least.)
Anyway, having two different eyes taught me to be able to switch between them as needed and to tense and relax the eyeball voluntarily – call it manual focus. I hear this can be learned in a short time even if your eyes are equivalent.
So, the trick is to learn to relax your eyeballs, deliberately making stuff go out of focus. When you do that, you should see things at some distance between 4m and infinity in perfect focus. Next, you should measure your desired working distance to your screen; mine is exactly at arm’s length.
Now you go to the optician and do all the standard procedures, except that you’ll hold that small eyechart at arm’s length, or whatever your preferred distance is, and relax your eyeballs throughout – think of “idly gazing into the distance”. I find that the resulting diopters are about 0.25 to 0.5 stronger than they are for my driving glasses, but of course YMMV. Ideally this should also be done without any of those pesky dilating eyedrops, as you want your eyes to be as near to the normal state as possible.
If you did this correctly, you should be able to sit at your screen for hours without any eyestrain. Of course you still should get up and stretch every thirty minutes or so, unless you also have an “infinity focus” chair…
I seem to remember hearing that there are modern laser-based machines that measure your lens directly without having you read charts or whatever; I suppose that if you run into such a thing, you’d have to do the “relax” trick while this is done. Be sure to talk it over with your optician; mine needed some convincing the first time.
Update: this article about computer glasses confirms my experience. You may want to check other articles on that site for more up-to-date information about vision problems and corrections (especially if you’re based in the USA).