-
Notifications
You must be signed in to change notification settings - Fork 0
/
finder.sh
executable file
·76 lines (54 loc) · 3.88 KB
/
finder.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" \
&& . "../../utils.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
print_in_purple "\n Finder\n\n"
execute "defaults write -g NSDocumentSaveNewDocumentsToCloud -bool false" \
"Sets default save target to be a local disk, not iCloud"
execute "defaults write com.apple.finder WarnOnEmptyTrash -bool false" \
"Disable the warning before emptying the Trash"
execute "defaults write com.apple.finder FXDefaultSearchScope -string 'SCcf'" \
"Search the current directory by default"
execute "defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false" \
"Disable warning when changing a file extension"
execute "defaults write com.apple.finder FXPreferredViewStyle -string 'clmv'" \
"Use column view in all Finder windows by default"
execute "defaults write com.apple.finder _FXSortFoldersFirst -bool true" \
"Keep folders on top when sorting by name"
execute "defaults write com.apple.finder ShowStatusBar -bool true" \
"Show status bar"
execute "defaults write com.apple.finder NewWindowTarget -string 'PfDe' && \
defaults write com.apple.finder NewWindowTargetPath -string 'file://$HOME/'" \
"Set home as the default location for new Finder windows"
execute "defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false && \
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true && \
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true" \
"Show icons for external hard drives, servers, and removable media on the desktop"
execute "defaults write com.apple.finder ShowRecentTags -bool false" \
"Do not show recent tags"
execute "defaults write com.apple.loginwindow TALLogoutSavesState -bool false && \
defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false" \
"Disable reopening windows when logging back in"
execute "/usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:iconSize 60' ~/Library/Preferences/com.apple.finder.plist && \
/usr/libexec/PlistBuddy -c 'Set :StandardViewSettings:IconViewSettings:iconSize 60' ~/Library/Preferences/com.apple.finder.plist" \
"Set icon size"
execute "/usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:gridSpacing 1' ~/Library/Preferences/com.apple.finder.plist && \
/usr/libexec/PlistBuddy -c 'Set :StandardViewSettings:IconViewSettings:gridSpacing 1' ~/Library/Preferences/com.apple.finder.plist" \
"Set icon grid spacing size"
execute "/usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:textSize 12' ~/Library/Preferences/com.apple.finder.plist && \
/usr/libexec/PlistBuddy -c 'Set :StandardViewSettings:IconViewSettings:textSize 12' ~/Library/Preferences/com.apple.finder.plist" \
"Set icon label text size"
execute "/usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:labelOnBottom true' ~/Library/Preferences/com.apple.finder.plist && \
/usr/libexec/PlistBuddy -c 'Set :StandardViewSettings:IconViewSettings:labelOnBottom true' ~/Library/Preferences/com.apple.finder.plist" \
"Set icon label position"
execute "/usr/libexec/PlistBuddy -c 'Set :DesktopViewSettings:IconViewSettings:arrangeBy grid' ~/Library/Preferences/com.apple.finder.plist && \
/usr/libexec/PlistBuddy -c 'Set :StandardViewSettings:IconViewSettings:arrangeBy grid' ~/Library/Preferences/com.apple.finder.plist" \
"Arrange icons in grid"
killall "Finder" &> /dev/null
# Starting with Mac OS X Mavericks preferences are cached,
# so in order for things to get properly set using `PlistBuddy`,
# the `cfprefsd` process also needs to be killed.
#
# https://github.com/alrra/dotfiles/commit/035dda057ddc6013ba21db3d2c30eeb51ba8f200
killall "cfprefsd" &> /dev/null