PRK Laser Eye Surgery Part 5

Author: Jeff Anderson

Optimizing My Desktop and Applications for Wacky Eyesight

This post was the initial motivation for writing about my PRK surgery on my blog. This contains what I did to make my workstation usable while my vision was a problem due to light sensitivity and healing.

X and DPI

My modifications started before my surgery. The first thing I wanted to do was to force a different DPI in my X server. I was running fluxbox with the "tar" theme, and logging in using gdm. I realized it was a touch easier changing the command for the X server if I switched to slim, so I dumped gdm. I just added -dpi 110 or so as an argument to be passed to the X server to effect the change. The higher the DPI, the "smaller" that believes the display is, and the more pixels it will take for the same font size. I first realized this when I plugged a computer into my 37" 1080P HDTV. The DPI on the HDTV is quite low, so a 12 point font renders in far fewer pixel sizes. I generally tend to "trick" the server into thinking that my HDTV is a smaller display using the same method.

Monospace Font

My fluxbox theme was already dark, and I had white on black colors set up in both xterm and urxvt. This was only by preference, but it ended up being an advantage in the long run. A co-worker introduced me to the Inconsolata font. This is a monospace font that is designed to work well at different sizes and resolutions. This is most helpful in print, since printers can render text at a much higher DPI than screens can. This was helpful in my case, since I needed very large characters. I ended up only having a terminal that was only about 15 or 20 rows high and 60 characters wide, when it was full screen.

Web Applications and Web Sites

My web browsing was the next biggest hurdle. The very first thing I did was increase font size. My light sensitivity didn't kick in to full gear at first. Increasing the default font size actually ended up breaking very few sites. The layout or images were sometimes destroyed, but very few actually broke. Unfortunately, the web application I used the most at work was the one that broke the worst.

This was a tabbed chat program. The tabs were fixed to a specific pixel width. They had a background image gradient that only worked with a specific size. The text in the tabs was also truncated by the server to a certain number of characters if it would have otherwise been too long. With the larger text size, this created a staircase effect, which took up so much screen real estate that the application became unusable at the very large sizes that I needed to be able to read anything.

This needed a CSS overhaul. Enter (greasemonkey)[]. I simply injected my own stylesheet that replaced the background images for the various tabs with solid background colors. In trying to preserve the look of the tab images, I added a gray border and set a -moz-border-radius on the top left and top right border. The tabs change color depending on how recent something was said in the chat. The javascript code that controls the color changing just switches out css classes, so the color changing still worked like a charm.

The next thing that I realized that needed to happen was to be able to make all web pages dark. There were lots of suggestions that were given to me including simply inverting the colors using a compositing window manager. This wouldn't work because it would make all the already-dark web pages bright again. I found a bookmarklet called Darken. It injects a CSS stylesheet into the current page, and uses the !important weight to override background and text styles. Text becomes white, and all backgrounds become black. Border colors are left untouched.

Reducing Light Levels around me

My light sensitivity got so bad that a week or two after the surgery, I felt like a vampire because I was so sensitive to light. Hiding in darkness, putting a coat over my head to go outside, etc. Even in the large room that I worked in that had the lights off, with my sunglasses, there was too much light from the outside windows. I was able to move my workstation to a room with no outside windows, and I could work in essentially complete darkness. This was very helpful. I went from dual monitors to just one. I had the one monitor set to 0 brightness and 12 contrast. The backlight was still on, it was just set as dim as it would go.

Still too Bright!

Darken worked really well, but I got to the point where I had to close my eyes if what was on the screen wasn't dark. I copied the javascript code in this bookmarklet, and put it into my own greasemonkey script. The only problem with this is that the style isn't immediately applied. The page loads before greasemonkey did its thing, so I'd get "flashes" of brightness when navigating to a new page. I'd click a link, and close my eyes very tightly. One can still sense light with eyes closed, so I'd just wait for the "flash" and then open my eyes again. An added advantage to running darken in greasemonkey rather than from a bookmarklet was that it applied to iframes as well, and not only the parent frame.

Since I was running darken, some applications didn't do quite as well as others. The chat program's colored tabs were gone, so I changed those grey borders I added to match the color of the tab. The result was a very 80s neon look in this program. The borders on elements other than the tabs were orange, and the tabs rendered as very bright or vivid green, red, blue, yellow, and orange borders.

I also used greasemonkey to add css border properties to another web application that had image-based rounded tabs that had been trampled by greasemonkey. I also was able to selectively increase the font of the text of tickets in a web-based ticket system using greasemonkey. Making the text large in the browser for the entire page didn't work out too well, so I injected CSS that affected only the text I needed bigger. The various function buttons (reply, close, delete) had icons, so it was just silly for their text to be really big.

My previous experience with css, javascript, and greasemonkey meant that these modifications didn't take too long, and they were spread out over several days. I did not take off any work due to my surgery. Without the modifications I was able to make to web applications and desktop applications, I wouldn't have been able to work at all.

Continue to Part 6

Posted: Apr 30, 2010 | Tags: PRK Linux Greasemonkey JavaScript

Comments are closed.