Skip to content

Instantly share code, notes, and snippets.

@admsyn
Created November 24, 2012 15:45
Show Gist options
  • Save admsyn/4140204 to your computer and use it in GitHub Desktop.
Save admsyn/4140204 to your computer and use it in GitHub Desktop.

Revisions

  1. Adam Carlucci revised this gist Nov 24, 2012. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,18 @@
    Add this .plist to ~/Library/LaunchAgents to have it automatically
    take effect whenever you log in. It will continue to be active until
    you log out (even if you delete the file).
    you log out (even if you delete the file).

    You can take manual control over it instead by putting the file
    anywhere else, then using launchctl like this:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    launchctl load com.admsyn.keep-twitter-alive.plist
    launchctl load path/to/the/plist/com.admsyn.keep-twitter-alive.plist
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    and

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    launchctl unload com.admsyn.keep-twitter-alive.plist
    launchctl unload path/to/the/plist/com.admsyn.keep-twitter-alive.plist
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Some notes :
  2. Adam Carlucci revised this gist Nov 24, 2012. 1 changed file with 17 additions and 5 deletions.
    22 changes: 17 additions & 5 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,29 @@
    Add this .plist to ~/Library/LaunchAgents to have it automatically take effect whenever you log in. It will continue to be active until you log out (even if you delete the file).
    Add this .plist to ~/Library/LaunchAgents to have it automatically
    take effect whenever you log in. It will continue to be active until
    you log out (even if you delete the file).

    You can take manual control over it instead by putting the file anywhere else, then using launchctl like this:
    You can take manual control over it instead by putting the file
    anywhere else, then using launchctl like this:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    launchctl load com.admsyn.keep-twitter-alive.plist
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    and

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    launchctl unload com.admsyn.keep-twitter-alive.plist
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Some notes :

    - It will keep itself from rebooting the app repeatedly over a short period of time (e.g. if it crashes it will reboot instantly, if it crashes again right away it'll wait ~10 secs before trying again). I believe this is adjustable with another param in the plist.
    - It will keep itself from rebooting the app repeatedly over a short
    period of time (e.g. if it crashes it will reboot instantly, if it
    crashes again right away it'll wait ~10 secs before trying again).
    I believe this is adjustable with another param in the plist.

    - launchd "owns" the app it spawns this way, so if you open the app yourself, then load the .plist, you'll get two copies of the app running.
    - launchd "owns" the app it spawns this way, so if you open the app
    yourself, then load the .plist, you'll get two copies of the app running.

    - Make sure the "Program" arg in the .plist points to the actual executable (e.g. in Contents/MacOS) instead of just the .app
    - Make sure the "Program" arg in the .plist points to the actual
    executable (e.g. in Contents/MacOS) instead of just the .app
  3. Adam Carlucci created this gist Nov 24, 2012.
    17 changes: 17 additions & 0 deletions README.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    Add this .plist to ~/Library/LaunchAgents to have it automatically take effect whenever you log in. It will continue to be active until you log out (even if you delete the file).

    You can take manual control over it instead by putting the file anywhere else, then using launchctl like this:

    launchctl load com.admsyn.keep-twitter-alive.plist

    and

    launchctl unload com.admsyn.keep-twitter-alive.plist

    Some notes :

    - It will keep itself from rebooting the app repeatedly over a short period of time (e.g. if it crashes it will reboot instantly, if it crashes again right away it'll wait ~10 secs before trying again). I believe this is adjustable with another param in the plist.

    - launchd "owns" the app it spawns this way, so if you open the app yourself, then load the .plist, you'll get two copies of the app running.

    - Make sure the "Program" arg in the .plist points to the actual executable (e.g. in Contents/MacOS) instead of just the .app
    12 changes: 12 additions & 0 deletions com.admsyn.keep-twitter-alive.plist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    <?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>com.admsyn.keep-twitter-alive</string>
    <key>Program</key>
    <string>/Applications/Twitter.app/Contents/MacOS/Twitter</string>
    </dict>
    </plist>