Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AndrewWCarson/3abedfb93cb59378c87f1467aabb6670 to your computer and use it in GitHub Desktop.
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.
#!/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
@AndrewWCarson
Copy link
Author

This is the original that I forked from @MacChuck. Needs way better user iteration and reading of home directories.

@AndrewWCarson
Copy link
Author

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