March 2010 Archives

I just upgraded to a (way too) shiny HP Pavilion dv8t laptop and a pair of inexpensive Sceptre 1080p LCD panels. The laptop seems work pretty well with Linux. I'm running Ubuntu 9.10 with a 2.6.34-rc1 kernel, before the laptop got here I read that the latest kernels have better support for Turbo Boost. I don't know for sure if the kernel is helping me but nearly every piece of hardware is working fine without any tweaking. So far I am unable to control bass/treble (the sub woofer makes it pretty loud this way), it does not report how fast the battery is being drained, and I'm unable to connect to my 802.11a access point.

These Sceptre LCD panels are WAY too red. I read warnings in the comments on Newegg before I bought them but I figured they couldn't be that bad. They are. Reds and oranges are quite bright. I've tried to tone them down and I'm not very happy with any of my results. I got exactly what I paid for.

What is All This Really About?

Enough about the new hardware! My goal was to be able to plug the laptop into the monitors and have everything just work without any manual intervention. If the two Sceptres are plugged in I want the desktop to automatically expand across them and shut of the laptop display. When they're unplugged I want it to revert to the laptop display.

Using Two Monitors with an Nvidia Card

I started with the open source driver and xrandr. Using the VGA port was not a problem. For some reason the open source driver was unable to detect when a device was plugged into the HDMI port. The proprietary Nvidia drivers did not have this problem. My hardware is able to drive any two out of the three displays. Unfortunately, it is not even able to use the third as a mirror of one of the other two.

Controlling the Outputs from the Command Line

I found an application called disper that makes it very easy to control the active outputs from the command line. First I used the nvidia-settings application to set up the two external displays the way I wanted them. Then I exported the settings with disper:

disper --export > ~/.disper-sceptre

Then I used nvidia-settings to set up the single laptop display and ran:

disper --export > ~/.disper-single

disper can list the displays that are connected:

wonko@zaphod:~$ disper --list
display DFP-0: CMO
 resolutions: 320x175, 320x200, 360x200, 320x240, 400x300, 416x312, 512x384, 640x350, 576x432, 640x400, 680x384, 720x400, 640x480, 720x450, 640x512, 700x525, 800x512, 840x525, 800x600, 960x540, 832x624, 960x600, 896x672, 928x696, 960x720, 1024x768, 1152x864, 1360x768, 1280x960, 1440x900, 1280x1024, 1400x1050, 1600x1024, 1680x1050, 1920x1080
display CRT-0: Sceptre X226W-1920
 resolutions: 320x240, 400x300, 512x384, 680x384, 640x480, 720x450, 700x525, 840x525, 800x600, 960x540, 832x624, 960x600, 1024x768, 1152x864, 1360x768, 1280x960, 1440x900, 1280x1024, 1400x1050, 1680x1050, 1920x1080
display DFP-1: Sceptre X226W-1920
 resolutions: 320x175, 320x200, 360x200, 320x240, 400x300, 416x312, 512x384, 640x350, 576x432, 640x400, 680x384, 720x400, 640x480, 720x450, 640x512, 700x525, 800x512, 840x525, 800x600, 960x540, 832x624, 960x600, 896x672, 928x696, 960x720, 1024x768, 1152x864, 1360x768, 1280x960, 1440x900, 1280x1024, 1400x1050, 1600x1024, 1680x1050, 1920x1080

I wrote a short daemon style shell script that periodically checks the connected displays and passes the correct settings to disper:

 #! /bin/bash

sleep 8  # The script crashes my X server if it ran too early

while [ 1 ];
do
  if [ `disper -l | grep -c X226W-1920` == 2 ]; then
    disper -i < ~/.disper-sceptre-dual
  else
    disper -i < ~/.disper-single
    sleep 2;
    xset dpms force on  # laptop display won't wake up without this
  fi

  sleep 10
done

I needed to add the xset dpms force on line or else my display would never wake up on its own. I don't know how specific that is to my hardware.

Xinerama and Xrandr

I don't see any reason why this couldn't be adapted to work with Xinerama and xrandr. xrandr can easily be used to detect and configure the displays. I know xrandr sometimes causes the screens to briefly go blank on my old laptop when it was detecting displays. That would be a bit problematic...

A Quick Port of App::EditorTools to Emacs

| No Comments | No TrackBacks

I saw an article about Stealing from Padre for Vim and I got a bit jealous that this functionality wasn't already available for Emacs. I guess I lucked out because it was very easy to make use of App::EditorTools in Emacs.

It probably took about a half hour to an hour to get this all up and running. The hardest part was actually tracking down the elisp functions that would return the current row and column of the beginning and end of a region. The terminology was just not easy to search for.

I did not include any default bindings in the package. I am still not entirely sure where their permanent home will be within my own config. For now I am using these:

(define-key cperl-mode-map (kbd "C-c e r") 'editortools-vim-renamevariable)
(define-key cperl-mode-map (kbd "C-c e t") 'editortools-vim-introducetemporaryvariable)

I don't think I want a binding for the renamepackage/renamepackagefrompath functions. I think I might set it up to call one of those automatically when I create a new file.

The elisp file can be found at:

http://rcs.patshead.com/dists/editortools-vim-el/

A Darcs repository is also available at http://rcs.patshead.com.

I am a huge fan of whiteboards. I can never have enough. Early last year I started hanginging some inexpensive 4 by 8 foot melamine panels in my new home office. One of the three walls wasn't big enough for a full sheet. I had to cut that one to 4 by 5 feet.

After over a year of use I am still very happy with all 84 square feet of melamine whiteboard. When I was first purchasing the melamine I read a lot of complaints about how hard it can be to cleanly erase them, especially after the ink has been on there for an extended period of time.

I am using Expo Low Odor Dry Erase Markers. I've read that they can be more problematic, but that is the only kind that were on the shelf the day I was shopping for them. One of the colors didn't like to erase very well. We hung some of the left over whiteboard inside the door of our pantry. Any colors that ended up being difficult (or ugly, like brown) ended up in there.

Most of the colors that I use have erased pretty easily even after setting in for two months or more, but at that point that usually require a bit more effort. Unfortunately, today I had my first complete failure at erasing. The area I was trying to erase had been written on for almost a full year.

I don't have any special whiteboard cleaners here. First I reached for my little bottle of screen cleaner, my own mix of a small amount of glass cleaner in water. It worked just as well as the undiluted glass cleaner I tried next, which is not at all.

Fortunately, I remembered that I had a cheap generic Mr. Clean Magic Eraser in the closet. I sprayed the whiteboard with my screen cleaner, since it was handier than water, scrubbed away. Everything came clean with barely any elbow grease. It was quite awesome!

I am apparently not the first person to think of this.

I did see some people who were wary of using these on whiteboards because they are a mild abrasive that might eventually wear down the writing surface. These melamine boards were very inexpensive. I wouldn't mind replacing them every few years.

About this Archive

This page is an archive of entries from March 2010 listed from newest to oldest.

February 2010 is the previous archive.

September 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Categories

Pages

OpenID accepted here Learn more about OpenID