Skip to content

Monthly Archives: October 2009

Bash, Senior Project, and Application Launcher

24-Oct-09

A while ago I installed a bunch of lib32-* packages as optional dependencies for something. I ended up not needing them for whatever reason (don't remember anymore), so I decided to remove them. The problem was that I also wanted to keep the lib32-* packages that I was actually using. Now, I had my pacman install logs, so I could easily get a list of the specific packages I wanted to remove. If I wanted to be a bit fancier, I could have python parse a section of the logs to generate a remove command to use. This wasn't good enough, though. I decided that I wanted to use a bash one-liner.

After a few hours, I changed my mind. Instead, I have this 7-liner:

TMP1=`mktemp`
TMP2=`mktemp`
yaourt --textonly -Ss lib32-* | grep installed | cut -d "/" -f 2 | cut -d " " -f 1 > $TMP1
yaourt --textonly -Q -t | cut -d "/" -f 2 | cut -d " " -f 1 > $TMP2
comm -12 $TMP1 $TMP2 | xargs yaourt -R
rm $TMP1
rm $TMP2

There might be an easier way, but if you have yaourt installed (this is for Arch Linux users) you can use this little script to remove all the packages matching some search (lib32-* in my case) that aren't required as dependencies for anything (including each other. Run multiple times to get those too.)

Next.

A while ago we received our conductive fabric, and we got nicer output from the accelerometer. It will still need to be "calibrated" at startup to some extent, but this will only require the user to have it not tilted more than 180 degrees from the desired neutral position when the calibration routine is run (which just deals with the first set of outputs from the accelerometer differently from all the others).

And finally:

I have uploaded a working implementation of the application launcher code I wrote a while ago. It doesn't use the panel applet GUI (my end goal), but it does work. Missing features include:

  • "Learning" from previous searches
  • Autodetection of environment (you need to set a few configuration variables manually)
  • Scrolling through results (you can only run the first result at the moment)

All this will be added in time.

Accelerometer Working!

05-Oct-09

Today we got the accelerometer working! We'll need to change how it is set up to get cleaner output, but we do in fact have some output. Also, our conductive fabric (which we had previously been told would be delayed for four weeks) will be here much sooner, though we needed to sacrifice the privilege of using pink fabric for the grey which we are now getting.

Next up is writing the code to use the accelerometer data to produce a rotation and vertical acceleration.

We also decided to document our work with photos, so I'll be uploading photos either to this site or to some photo hosting site at some point.

As a side note, I am also writing a program to use a wacom tablet as instrument with Python + Pygame. Pressure will map to volume, vertical position to frequency, and horizontal position to time until note is played. The interface will be a leftward-scrolling window in which you can draw with the wacom tablet. When whatever you have drawn hits the left side of the window, it will make sound. I'll post more about this later, but if anyone has a good way of getting Wacom Tablet pressure data in Python, feel free to tell me. For some reason reading from /dev/input/wacom (a symlink to whatever /dev/input/event* the tablet is actually mapped to) doesn't work, and I can only get position data using Python's Xlib bindings. It also does not show up as a joystick in Pygame (my laptop's accelerometer does, though), which would have been nice.