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.
Hide MAMP Dock Icons Shell Scripts
#!/bin/bash
# Place this script in dir: /usr/bin
# 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)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment