-
Notifications
You must be signed in to change notification settings - Fork 0
/
.macos
executable file
·129 lines (95 loc) · 3.96 KB
/
.macos
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env bash
#
# Refs: https://macos-defaults.com/
#
set -ex
# Close any open System Preferences panes,
# to prevent them from overriding settings about to change
osascript -e 'tell application "System Preferences" to quit'
sudo -v
: "Disable the sound effects on boot"
sudo nvram SystemAudioVolume=" "
: "Always show scrollbars"
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
defaults write com.apple.screencapture disable-shadow -boolean "true"
##################
# Keyboard & input
##################
: "keyboard: key repeast"
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 20
: "keyboard: spell auto fixer"
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool "false"
# get string like : 1452-630-0 for keyboard_id (ref: http://freewing.starfree.jp/software/macos_keyboard_setting_terminal_commandline)
: "keyboard: CapsLock <-> Ctrl"
keyboard_id="$(ioreg -c AppleEmbeddedKeyboard -r | grep -Eiw "VendorID|ProductID" | awk '{ print $4 }' | paste -s -d'-\n' -)-0"
defaults -currentHost write -g com.apple.keyboard.modifiermapping.${keyboard_id} -array-add "
<dict>
<key>HIDKeyboardModifierMappingDst</key>\
<integer>30064771300</integer>\
<key>HIDKeyboardModifierMappingSrc</key>\
<integer>30064771129</integer>\
</dict>
"
: "TextEdit: make default to plain text"
defaults write com.apple.TextEdit RichText -int 0
########
# screen
########
: "Save screenshots to the desktop"
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
: "Disable shadow in screenshots"
defaults write com.apple.screencapture disable-shadow -bool true
######
# Dock
######
defaults write com.apple.dock "orientation" -string "bottom"
: "Dock: hide always"
defaults write com.apple.dock "autohide" -bool "true"
##################
# Finder & Desktop
##################
: "Finder: show extensions"
defaults write NSGlobalDomain AppleShowAllExtensions -bool "true"
: "Finder: show hidden files"
defaults write com.apple.finder "AppleShowAllFiles" -bool "true"
: "Finder: show path bar"
defaults write com.apple.finder ShowPathbar -bool "true"
# clmv=Column view, Nlsv=List view
: "Finder: default view style"
defaults write com.apple.finder "FXPreferredViewStyle" -string "clmv"
: "Finder: keep folders on top"
defaults write com.apple.finder "_FXSortFoldersFirst" -bool "true"
: "Finder: changing file extension warning"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool "false"
: "Finder: Display full POSIX path as Finder window title"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool false
: "Finder: Keep folders on top when sorting by name"
defaults write com.apple.finder _FXSortFoldersFirst -bool true
: "Finder: Avoid creating .DS_Store files on network or USB volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
: "Desktop: keep folders on top"
defaults write com.apple.finder "_FXSortFoldersFirstOnDesktop" -bool "true"
##################
# Mouse & Trackpad
##################
: "Mouse: set movement speed"
defaults write NSGlobalDomain com.apple.mouse.scaling -float "5"
: "Trackpad: click weight (threshold)"
defaults write com.apple.AppleMultitouchTrackpad "FirstClickThreshold" -int "0"
: "Trackpad: enable tap to click for this user and for the login screen"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
: "Trackpad: 調べる&データ検出 < 3本指で"
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerTapGesture 2
# FIXME: crash on macOS Sonoma
#: "Trackpad: silent click"
#defaults write com.apple.AppleMultitouchTrackpad ActuationStrength 0
#defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad ActuationStrength 0
#########
# Finally
#########
killall Dock
killall Finder
killall SystemUIServer