Quicksilver replaces Terminal


Not only does Quicksilver replace Overflow, it can save you from having to constantly open the Terminal as well.

If you have the Terminal module installed, not only can you “Run a Text Command in Terminal”, you can also “Run Command in Shell”. Never tried it? You should. Terminal Module

Running a command in shell means that you don’t have to open and close the Terminal all the time. You can run all your commands straight from the comfort of your own home… er, Quicksilver.

Let’s take an example command that one may run in Terminal.app. defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder That’s actually two commands, the first line writes the preference, and the next one relaunches the Finder. Remember how we used to do that.

Terminal is boring

Remarkably, you don’t even need to open the Terminal anymore.

Behold:

Shell command from QS

You’ll note that I typed in both commands at once. What’s going on? Well, what you see is indeed two commands separated by a line break. This will run both commands separately. Use option-return to get a line break.

Implications

What can you do with this?

You can Create a trigger to show hidden files and another to hide them again; triggers to show / hide the expose blob, change application settings, run an svn update, or even set your screensaver as the desktop background! This is also a real time-saver for those repetitive tasks, and is a great trick to know.

One of the things I like to do with this is to write in "killall Dock" -> Run command in shell, then press Ctrl-Return to save it. Then, Ctrl-Shift-Click on the minimize button, and while it’s halfway through the genie effect, invoke QS and run the command. Warped windows ahoy.

Limitations

There are a few limitations with this trick. I haven’t seen shell commands return anything, so Kelan points out that the command’s response is brought to the main selector if there is one. (eg. running uptime), but for more advanced things like FTP, or commands where you need to get the result of the script, this is not the best option. However, it’s the best way to run simple commands that would otherwise be run in the Terminal.


Back to Top ↑

17 Comments so far

Leave a comment
  1. 1

    have you tried visor?

    another blacktree miracle that brings up the terminal with a hotkey.

  2. 2

    For some reason combinding this with the comma trick doesn’t work. I tried to kill the Finder and the Dock at the same time, but nothing happend.

    This shows up in my Console:

    2007-04-26 23:43:30.371 Quicksilver[3202] Task failed.
    /bin/sh: line 1: combined: command not found

    Ah, well there’s always the ‘;’…

  3. 3

    mnewsom, I haven’t tried Visor, actually. I’ll give it a shot now. However, the real power of the above trick is that you can set it up as a trigger to run the command, not just show the window.

    Sphynx, instead of the comma trick, separate each command with a line break (press option-return). By using the comma trick, QS is sending a combined object and shell doesn’t know what to do with it. So kill the Finder and Dock at the same time, type:

    killall Dock
    killall Finder

    into the first box, then run in shell.

  4. 4

    For me, if the command returns text, QS brings that into a new invocation of itself, as entered text. So, you can then just read in there (if you can see it all. I usually can’t because I run the flashlight interface) or you can tab over and do something with it (for example: display it as “large type”). This isn’t the most convenient thing, but it works ok for things like ‘uptime’

  5. 5

    You’re right! I should have experimented a bit more.

  6. 6

    I’m sort of new to all of this. Does anyone know why the subject: “javac ~/Code/javaSource.java” and action “Run command in shell” doesn’t work with this trick? I’ve been looking for a way to compile and run java source from QS but haven’t had any luck so far. I thought this was it.

  7. 7

    Luke, you may have to put a cd command before it to navigate to where the javac command is located (there’s an alias to it in /usr/bin/).

  8. 8

    I’m a few months behind here, as well as a relative newcomer without programming chops. Had the following problem: typed “.”; entered a terminal command; tabbed over; typed “run . .” and ‘run command in shell’ came up; hit enter. What happened is, the command ran in a briefly appearing terminal shell box. When finished, the shell box disappeared, and Quicksilver did too: I had to re-launch it. There it is. Why? Any ideas? Thank you.

  9. 9

    Fred, sounds like Quicksilver crashed. What command did you run? Try something like “uptime” for a start.

  10. 10

    Yes, QS crashed. Ran ‘uptime’ and it worked fine. Tried ‘top’ and it crashed again. I just had installed the latest B52 Build 3804, and wondered, maybe a problem there, so quit, re-launched Beta 51, but had the same behavior. ‘top’ doesn’t work; ‘uptime’ did. Thanks for the attention to this.

  11. 11

    My Unix skills aren’t too great, but I don’t think top would work here as it doesn’t return anything immediately, but keeps running(?). Most other things work, though. man works, as do defaults, uptime, ls, cd and so on.

  12. 12

    Okay Ankur, I think I have this figured out. For the commands that return text and then finish, the text shows up in a new iteration of QS, which can be displayed by ‘large type’ (though truncated by the screen size, it appears). ‘top’ or ‘top 10′ doesn’t work because, as you’ve said, it dynamically updates (in terminal) and won’t quit without ^C (I’m not sure why that crashes QS, however). I first tried to use this to run the DOS emulator DOSBox in shell rather than ‘run command in terminal’, which worked, but necessitated the extra step of quitting terminal once I had finished. This didn’t work at first for the simple reason that I hadn’t included a ‘cd’ command on invocation to point the shell at the DOSBox executable (see Luke’s May 2 post and your response above). So easy to forget/overlook the shell’s directory navigation requirements. All’s right. Thank you.

  13. 13

    A brief addendum: there’s a top 10 script plugin that can be used to see the top 10 running processes in the QS first pane (and then to ‘large type’ if desired).

  14. 14

    Is there a way to get aliases to work with this? I have added my aliases to .bash_profile, .cshrc, and .tcshrc, but none appear to work.

  15. 15

    Tried this:
    /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &

    It works but QS hangs! Any ideas of why?
    Thanks
    ps: not useful if it knocks out QS.

  16. 16

    i hate to be the retarded newbie… but i installed the terminal module, and still, when i invoke qs, hit [.] to go into text mode, and type something simple like [ pbpaste | pbcopy ] in the “subject” pane, i never get the “verb” pane to show me the [run in shell] action. what am i doing wrong?!

    also, i have the proxies enabled, and i can see menu items brilliantly in, say, safari. but i [show menu items] is not an action inside ichat. anyone have a similar problem?! what gives?

RSS feed for comments on this post. TrackBack URI

Leave a comment

Comments may be edited for formatting.