SpotCmd – launching Terminal commands from Mac OS X Spotlight

If you craved for launching Terminal commands from your Spotlight search window, today is your lucky day. I also had that wish and dedicated my whole Sunday to master the arcanes of mach_inject, taskgated, self-signed certificates, Hopper disassembler, class-dump, security add-trusted-cert, macinstallerapp, etc. etc. in order to deliver you this nice application (with installer) which will load a bundle into SystemUIServer process and swizzle some methods in order to make our dreams come true 😉

As you can see above, with my plugin Spotlight is now aware that what you’re typing might actually be interpreted as command line input. If you select that possibility, a Terminal window will be launched and execute your query verbatim. For the ping google.com example this is what pops up:

As announced earlier, I have been quite professional with this one and prepared an installer. My main motivation was that it requires a fair amount of modifications before it can inject code into Spotlight, enough to discourage an average user. If you’re interested what’s happening behind the scenes, just open the Installer and look for sample.tar and its content, especially install2.sh which pretty much summarises the installation process.

In any case… unpack, run the installer, enjoy and give feedback!

DOWNLOAD: SpotCmdInstaller.zip

11 Comments

  • Hi,

    I found this while looking for a way to launch commands form spotlight — and was really happy when I saw this. Unfortunately the status bar stops working after install, and i cannot launch command from spotlight. Was this created from an earlier version of OS X? And would you happen to have made an uninstaller since it’s quite irritating to not have the status bar working :-/

    /Denis

  • Actually it should work. I’m using it with the most recent version of OS X AFAIK – will take a look today. To disable it just rm -rf /Applications/SpotCmd. It should do the trick. Do you happen to have some logs from the Console? Cheers.

  • Hi,
    for some mysterious reason i could not delete it in terminal with rm.

    Had to reboot and could then delete it file for file. Maybe a problem of my machine or me, but i think there was (a not to easy to identify) process running which stopped me deleting.

    Your idea is great, but did not work at my computer.

  • Hi,
    yesterday i tried to delete the trash folder.

    The soptcmd folders get “permission denied”.
    I tried xchmod, but can’t see here any problems.

    Could you please post what spotcmd changes in osx and how we can get rid off it.

  • Hi,
    think i found why it’s actually not working anymore.

    The self signed certifikate god.cer ended at 16. Sept 2014!

    Is it not a security hole to install such a certifikate of you?

    Because of this i will try to build my own. Some howto would be useful!

    greets


Leave a Reply to Jeff Cancel reply

Your email address will not be published. Required fields are marked *