-
Notifications
You must be signed in to change notification settings - Fork 3
/
dotils
executable file
·101 lines (73 loc) · 3.12 KB
/
dotils
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
set -e
ARGS=(osx help)
CWD=`pwd`
## Public API
# -----------------------------------------------------------------------------
#/ osx Sets reasonable OS X defaults for a new system [http://mths.be/osx], take a look before running.
osx() {
# Show the ~/Library folder
chflags nohidden ~/Library
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
# Disable send and reply animations in Mail.app
defaults write com.apple.Mail DisableReplyAnimations -bool true
defaults write com.apple.Mail DisableSendAnimations -bool true
# Copy email addresses as `[email protected]` instead of `Foo Bar <[email protected]>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Disable press-and-hold for keys in favor of key repeat
# defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
# defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Always open everything in Finder's list view.
# defaults write com.apple.Finder FXPreferredViewStyle Nlsv
echo "Done. Note that some of these changes require a logout/restart to take effect."
}
#/ help Print this message
help() {
cat<<EOF
Usage: ./$(basename "$0") [${ARGS[@]}]
Commands:
$(print_usage)
- Mode Set thinks you're sexy.
EOF
}
# Get usage from the public api comments starting with `#/`
print_usage() {
cat $(basename "$0") | grep '^#\/' | sed "s/#\///g" | while read line; do
printf "%2s$line\n"
done
}
# See if a valid argument is passed and call it...
if [[ $1 != "" ]]; then
for fn in "${ARGS[@]}"; do
if [[ "$fn" == $1 ]]; then
$fn
exit 0
fi
done
fi
# ...otherwise barf out a help warning
printf "%sNot sure what to do here so calling for help!\n\n"
help
exit 0