Skip to content

Instantly share code, notes, and snippets.

@og-shawn-crigger
Forked from josue/MAMP-DOCK-INVISIBLE.sh
Last active December 10, 2015 20:18
Show Gist options
  • Save og-shawn-crigger/4486696 to your computer and use it in GitHub Desktop.
Save og-shawn-crigger/4486696 to your computer and use it in GitHub Desktop.

Revisions

  1. og-shawn-crigger revised this gist Nov 4, 2014. No changes.
  2. Josue Rodriguez revised this gist Apr 4, 2012. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions MAMP-DOCK-INVISIBLE.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,12 @@
    #!/bin/bash

    # Place this script in dir: /usr/bin
    # Change permissions: chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
    # Ensure the MAMP 'info.plist' file has the following entry: <string dock-visible="1">NO</string>
    # Change permissions: sudo chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
    #
    # Ensure the MAMP 'Info.plist' file has the following entry:
    # <key>LSUIElement</key>
    # <string dock-visible="1">NO</string>
    #
    # Usage:
    # MAMP-DOCK-INVISIBLE 1 ... (hide dock icon)
    # MAMP-DOCK-INVISIBLE 0 ... (show dock icon)
  3. Josue Rodriguez revised this gist Mar 27, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions MAMP-DOCK-INVISIBLE.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@

    # Place this script in dir: /usr/bin
    # Change permissions: chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
    # Ensure the MAMP 'info.plist' file has the following entry: <string dock-visible="1">NO</string>
    # Usage:
    # MAMP-DOCK-INVISIBLE 1 ... (hide dock icon)
    # MAMP-DOCK-INVISIBLE 0 ... (show dock icon)
  4. Josue Rodriguez renamed this gist Mar 27, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. Josue Rodriguez created this gist Mar 27, 2012.
    33 changes: 33 additions & 0 deletions MAMP-DOCK-INVISIBLE
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    #!/bin/bash

    # Place this script in dir: /usr/bin
    # Change permissions: chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
    # Usage:
    # MAMP-DOCK-INVISIBLE 1 ... (hide dock icon)
    # MAMP-DOCK-INVISIBLE 0 ... (show dock icon)

    cd /Applications/MAMP\ PRO/MAMP\ PRO.app/Contents

    echo
    echo "... quiting MAMP PRO if active ..."

    osascript -e 'quit app "MAMP PRO"'
    echo

    if [ $1 ] && [ "$1" -eq 1 ]; then
    echo "... Hiding MAMP Pro from DOCK ..."
    sed 's/<string dock-visible="1">NO<\/string>/<string dock-visible="1">YES<\/string>/g' Info.plist > Info.plist_new
    else
    echo "... Showing MAMP Pro in DOCK ..."
    sed 's/<string dock-visible="1">YES<\/string>/<string dock-visible="1">NO<\/string>/g' Info.plist > Info.plist_new
    fi

    cat Info.plist_new > Info.plist
    rm Info.plist_new

    sleep 3

    echo
    echo "... Restarting MAMP Pro ..."
    open ../
    echo