BrT

Musings about technology and other neat stuff

BrT random header image

Using launchd to immortalize Quicksilver (howto)

January 28th, 2008 · 5 Comments

I love Quicksilver, but the latest version crashes every once in a while. It’s not so frequent as to be really annoying, but the annoying part is that to re-launch it I have to go hunting in the Applications folder, or use Spotlight, none of which is an acceptable alternative being used to Quicksilver.

It occurred to me that I could use launchd to automatically re-launch QS when it crashes. It works very nicely, here’s what I did:

  • In the QS preferences, disable “start at login”
  • Create a new LaunchAgent in my account by storing the following file as ~/Library/LaunchAgents/org.quicksilver.plist (actually I used Lingon to create the file – very handy utility!):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>KeepAlive</key>
            <true/>
            <key>Label</key>
            <string>org.quicksilver</string>
            <key>ProgramArguments</key>
            <array>
                    <string>/Applications/Quicksilver.app/Contents/MacOS/Quicksilver</string>
            </array>
    </dict>
    </plist>
    
    
  • Log out and back in – voila! QS is started automatically, and if it dies for any reason, launchd will automatically restart it.

Of course, this can be used to immortalize any program that you want to keep running all the time.

Tags: · · ·

5 responses so far ↓

  • 1  seyDoggy // Jan 30, 2008 at 6:42 pm

    Brilliant! Just did this trick myself and it works famously. I’ve crashed QS twice this afternoon and both times it popped back up with no effort.

  • 2  Jasper // Jan 30, 2008 at 11:33 pm

    nice one! thanks for this. I’ve just discovered launchd, and I love it for stuff like this.

  • 3  seyDoggy // Jan 30, 2008 at 11:44 pm

    I’m not sure why, but it worked fine on my G5 tower running Leopard, but didn’t work on my MacPro tower running Leopard.

    Any insight or am I just lucky that way? Thanks.

  • 4  Hitchhiker // Jan 30, 2008 at 11:45 pm

    seyDoggy, Jasper: thanks for the comments! I’m glad you found the tip useful.

    seyDoggy: not sure why it wouldn’t work on one machine. Are you sure you created the file correctly?

  • 5  seyDoggy // Jan 30, 2008 at 11:58 pm

    I did the same thing in both cases, worked on one machine, not the other:

    • Copied your xml above
    • invoke Quicksilver
    • tap “.”
    • paste in the text box
    • tab to next panel
    • open text with PlistEdit Pro
    • Save as ~/Library/LaunchAgents/org.quicksilver.plist

    I’m trying to sort it out now but I am stumped.