Showing posts with label usb. Show all posts
Showing posts with label usb. Show all posts

2011/09/14

Pretty lights

In a fit of weakness, I bought 2 silly USB mail lights. This are basically a PIC that talks USB on one side, and turns coloured leds on and off. They come with software that is supposed to check if you have mail and change colour depending on what's going on. Of course, the supplied software is Windows only and doesn't even work it seems.

Not that I care about a light that tells me if I have e-mail pending. But controling pretty lights from the computer? I'm all over that. Someone had already written a script in Python to control these things. I ported it to Perl because, well because I like Perl.

To use it, you must have Device::USB installed. And perl, of course.

http://pied.nu/Perl/setcolour

Doing setcolour will show you all devices installed

Doing setcolour 1294:1320 1 will set all mail devices to colour 1, which is blue on one of my devices, green on the other.

Doing setcolour 2-7 2 will set one mail device to colour 2, which is red on both my devices.

2010/09/30

A mixed bag

I ordered a BlacX SATA/IDE/USB docking station today. Should have bought one back when I first discovered them. Would have made all the farting around with Corey a lot less painful.

In other news, I discovered that getting xterm to use TrueType fonts is as simple as -fa NAME-PT. As in:
xterm -r -fa Consolas-17

Consolas, if you didn't know, is a nice little monospaced font that MS commissioned, tuned to LCD screens. The previous link downloads a bloody useless setup.exe. So I downloaded the .ttf from elsewhere.

Also, you might be interested in this review of programming fonts from 2007. Though he seems to think that 11pt is legible.

Finally, a snippet to get the current X resolution. I needed this to adjust the font size based on resolution. My users want the terminal to fill the screen.
read prop Xsize Ysize < <(xprop -notype -root 32cc ' $0 $1\n' _NET_DESKTOP_GEOMETRY)

echo "${DISPLAY:-Display} is ($Xsize,$Ysize)"

If you didn't know about Process Substitution you do now.