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/sh | |
# Add Touch Icons to Safari's cache | |
# Theory of operation is that the domain from the URL of each bookmark is MD5 hashed and used as the filename of a PNG stored in $DIR | |
# The URL is the domain and subdomain, with no protocol, or path. So for example "app.slack.com" or "discordapp.com". | |
# Yes this means that multiple sites might collide, and seems to be a weakness of Safari's scheme. | |
# So this script searches Bookmarks.plist to find the bookmark in question, grabs the URL, hashes it, and copies the new icon named $DIR/${HASH}.png | |
# Usage: Create PNG files named the same as a bookmarks you want to add. So to add a Touch Icon for a bookmark called Gmail, create a PNG called Gmail.png. Run this script in the directory with the PNGs. | |
DIR="$HOME/Library/Safari/Touch Icons Cache/Images" |