-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.macos
110 lines (97 loc) · 5.7 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
#!/bin/bash
# inspired by https://github.com/mathiasbynens/dotfiles/blob/main/.macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
###############################################################################
# MOUSE #
###############################################################################
# Change mouse scroll direction
defaults write -g com.apple.swipescrolldirection -bool FALSE
###############################################################################
# KEYBOARD #
###############################################################################
# Turn off Press-and-Hold for keys in favor of key repeat (used for vim)
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
defaults write com.vscodium ApplePressAndHoldEnabled -bool false # For VS Codium
defaults write com.microsoft.VSCodeExploration ApplePressAndHoldEnabled -bool false # For VS Codium Exploration users
defaults delete -g ApplePressAndHoldEnabled
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
###############################################################################
# SCREEN #
###############################################################################
# Dark mode
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to true'
###############################################################################
# VOLUME #
###############################################################################
# Mute volume
osascript -e 'set volume output volume 0'
# Mute alert volume
osascript -e 'set volume alert volume 0'
# Disable UI sound effects
defaults write "Apple Global Domain" com.apple.sound.uiaudio.enabled -int 0
# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
###############################################################################
# SCREENSHOTS #
###############################################################################
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
###############################################################################
# FINDER #
###############################################################################
# Show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# set home folder as the default location for new Finder windows
defaults write com.apple.finder NewWindowTarget -string "PfHm"
###############################################################################
# DOCK #
###############################################################################
# Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock tilesize -int 20
# Don’t animate opening applications from the Dock
defaults write com.apple.dock launchanim -bool false
# Remove the auto-hiding Dock delay
defaults write com.apple.dock autohide-delay -float 0
# Remove the animation when hiding/showing the Dock
defaults write com.apple.dock autohide-time-modifier -float 0
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Don’t show recent applications in Dock
defaults write com.apple.dock show-recents -bool false
# enable magnification
defaults write com.apple.dock magnification -bool true
# set magnification size
defaults write com.apple.dock largesize -int 64
###############################################################################
# DESKTOP #
###############################################################################
defaults write com.apple.finder CreateDesktop -bool false
###############################################################################
# BROWSER #
###############################################################################
# use chrome as the default browser
open -a "Google Chrome" --args --make-default-browser
###############################################################################
# Kill affected applications #
###############################################################################
for app in "Dock" \
"Finder" \
"SystemUIServer"; do
killall "${app}" &> /dev/null
done