Running a shell script at application launch

Discussion in 'Mac Programming' started by 051r15, Mar 15, 2011.

  1. 051r15 macrumors newbie

    Mar 15, 2011
    Hi forums, this is my first post! Im trying to run this script automatically when I launch terminal :

    /System/Library/Frameworks/ScreenSaver.framework/Resources/ -background

    it's a matrix digital rain screensaver I'd like to run in the background when terminal is launched, purely to show off. Can this be done in automator? If so, how would I go about doing that? I've looked around google, and not found anything useful.

    Thanks in advance for any help! I will try and return the favor sometime.
  2. jiminaus macrumors 65816


    Dec 16, 2010
    One possible way:

    1. Terminal | Preferences
    2. Settings
    3. Select whichever is the default settings
    4. Shell
    5. Run command
    6. Paste your command then put a space followed by a &
    7. Run inside shell

    Then next time a Terminal window is opened the command will run in the (process) background.
  3. 051r15 thread starter macrumors newbie

    Mar 15, 2011
    Right on! Many thanks! The effect is cold-blooded :cool: . So does the "&" at the end tell the application to stop the script upon quitting? That's the effect I was going for, hadn't yet found the right command... Again, thanks a million!
  4. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    No the & tells it to detach the task from the console and let it run in the background. Closing the process that launched it may have a side effect of killing the background job too, but that's not what the & is meant for.

  5. 051r15 thread starter macrumors newbie

    Mar 15, 2011
    Okay, here's the full command, along with a screenshot of the screensaver and color of terminal at once. Quite the effect, especially with the voice.

    /System/Library/Frameworks/ScreenSaver.framework/Resources/ -background & say -v zarvox nooobs sayonara all your base are belong to us ich nii saan shi destroy

  6. 051r15 thread starter macrumors newbie

    Mar 15, 2011
    Thanks for the link and clarification on the "&". I'm trying to seriously beef up the command line skills.

Share This Page