Forked from MacChuck/DisableIconPreviewHighSierra.sh
Last active
August 23, 2018 04:50
-
-
Save AndrewWCarson/3abedfb93cb59378c87f1467aabb6670 to your computer and use it in GitHub Desktop.
Disables icon previews and preview column for all users in macOS High Sierra.
This file contains hidden or 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 | |
# This disables the Column View icon in Finder for all users | |
# Change file separators so we don't get hung up on spaces | |
OIFS=$IFS | |
IFS=$'\n' | |
# Iterate through all users | |
for user in $(dscl . list /Users UniqueID | awk '$2 >= 500 {print $1}'); do | |
userHome=$(dscl . read /Users/"$user" NFSHomeDirectory | sed 's/NFSHomeDirectory://' | grep "/" | sed 's/^[ \t]*//') | |
# Delete the existing column preview setting | |
/usr/libexec/PlistBuddy -c "Delete StandardViewOptions:ColumnViewOptions:ShowIconThumbnails" "$userHome/Library/Preferences/com.apple.finder.plist" | |
/usr/libexec/PlistBuddy -c "Delete StandardViewOptions:ColumnViewOptions:ColumnShowIcons" "$userHome/Library/Preferences/com.apple.finder.plist" | |
# Reset the column preview setting to off | |
/usr/libexec/PlistBuddy -c "Add StandardViewOptions:ColumnViewOptions:ShowIconThumbnails bool false" "$userHome/Library/Preferences/com.apple.finder.plist" | |
/usr/libexec/PlistBuddy -c "Add StandardViewOptions:ColumnViewOptions:ColumnShowIcons bool false" "$userHome/Library/Preferences/com.apple.finder.plist" | |
chown "$user" "$userHome/Library/Preferences/com.apple.finder.plist" | |
done | |
# Delete prefs/plist cache | |
killall cfprefsd | |
# Restart the Finder | |
killall Finder | |
# Reset file separators just in case... | |
IFS=$OIFS |
Should be good now. Haven't test, but just did some simple copy-pasta with other scripts. All passed on shellcheck.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the original that I forked from @MacChuck. Needs way better user iteration and reading of home directories.