Automatically restart applications on OS X


I use GimmeSomeTune to provide hotkeys and some other goodies for iTunes. It works alright, but is veeeery crashy – usually every dozen hours or so on my machine. How to fix that? Let's relaunch it as soon as it crashes. Simple! In a terminal: for (( ; ; )); do open -W /Applications/Multimedia/; done open is the bash command to launch applications on OS X. It works with all kinds of files: open somefile.

A bit of Terminal-fu

         ·      · ·

Yesterday, my little brother was typing something on a linux bash and suddenly went back to the beginning of the line with a simple Ctrl-a. It blew my mind. I don't know why, but it never occurred to me to look for shortcuts in Terminal (and bash in general), other than Ctrl-c for badly behaving processes. I just cursed myself and frantically typed on the left arrow key each time I typed cd instead of cp.

A keyboard shortcut to change files colours in the Finder?


My usual habit (some would call it an intermittent OCD, but meh) of sorting and organizing files and folders to a great extend and my almost as severe relentless longing for optimisation recently met in an existential question: is it possible to colour files in the Finder through a keyboard shortcut? OS X lets you add colours -or “labels”- to a file by right-click or in the Finder's File menu. GUI are cool, but get in the way of efficiency once you know your keyboard inside and out.

Seitunes 1.0


Seitunes v1 is here! I think everything I need it to do is in here. I'm not planning on adding new features in the near future - if anything, I'll concentrate on optimizing performance. Sei what? Seitunes is a command-line interface for iTunes. It allows you to see what's playing in iTunes and control it (play, pause, set volume, toggle shuffle, select a playlist, set song rating) from your terminal.

Fix ncurses in OS X 10.6.3


In response to my blog post about the issue affecting arrows under OS X 10.6.3, Jonathan Groll pointed out that copying the ncurses libraries from an old 10.6.2 install would fix the problems. It works, but manipulating libraries in that way still feels a bit wrong to me. And that's without even mentioning the security implications of getting these libraries from “somewhere on the internet” if you don't have them laying around anymore.

Tunneling iTunes through SSH

              · ·

If you want to listen to your music library on the go, you can tunnel iTunes through SSH in a few easy steps. First of all, you have to enable sharing in iTunes: iTunes > Preferences > Sharing > Share my library on my local network. This will announce your library on your local network using multicast DNS, provided by Apple's implementation of zeroconf: Bonjour. The library can then be accessed on port 3689 of the computer mDNS announced.

Slim down applications: Trimmit


Applications on Mac OS typically include a lot of stuff most people won't use daily, especially translations in foreign languages and builds for different architectures (x86, x86_64, PPC and PPC 64 bits). A handful of utilities exist to trim down applications. I personally use Trimmit, a free-as-in-beer software that gives excellent results, as long as it's used carefully. For example, let's take the latest version of iTunes (v9.1) under Snow Leopard.

Changing an application icon under OS X


I don't like the default icon for in OS X. The sight of that child, giving me this creepy grin, sitting here in the Dock while I'm browsing pictures, is just weird. There are two ways to make him go away. The hard way I call this method the hard way because it involves having another .icns file (the filetype for OS X icons), and navigating through folders supposed to be hidden.

Seitunes v0.8


Version 0.8 of Seitunes is here! Apart from finishing implementing the core functions, I focused on code clarity and performance enhancements. Code All major Applescript interactions with iTunes now go through separate C functions instead of “oh hey just do it here in main()” as before. These functions act as wrappers to access iTunes, and can be re-used for any other project. I could even put them in a separate file and call it a library :)

OS X 10.6.3 broke ncurses

              · ·

As I was working on my Seitunes project, I noticed something strange: the arrows didn't quite work any more. Instead of their proper action (up & down to change volume, right & left to change song), they all quit the program and printed -respectively- “OA”, “OB”, “OC” and “OD” on the stdout. I tried to go back to a working state by progressively deleting new features I was implementing, until I had exactly the same code as the (known working!