-
-
Save og-shawn-crigger/4486696 to your computer and use it in GitHub Desktop.
Hide MAMP Dock Icons Shell Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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