-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosconfig.sh
executable file
·113 lines (100 loc) · 3.89 KB
/
osconfig.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
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
#!/bin/bash
# Heavily inspired by https://github.com/mathiasbynens/dotfiles/blob/main/.macos
# Special thanks to: GitHub Copilot and https://macos-defaults.com/finder/appleshowallextensions.html
echo "[osconfig] INFO: Installation started"
# 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'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
done 2>/dev/null &
# Dock
# ====
# Smaller dock
defaults write com.apple.dock tilesize -int 36
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Instant dock hiding
defaults write com.apple.dock autohide-delay -float 0
# Instant dock showing
defaults write com.apple.dock autohide-time-modifier -int 0
# Remove recents from dock
defaults write com.apple.dock show-recents -bool false
# Show open application indicator
defaults write com.apple.dock show-process-indicators -bool true
# Restart Dock (execute last)
killall Dock
# Menu bar
# ========
# Get rid of all the default menu bar items
# Show battery percentage
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
# Show playing now when active
defaults write com.apple.menuextra.airplay ShowInMenuBarIfPresent -bool true
# Show focus mode when active
defaults write com.apple.menuextra.clock ShowFocusModes -bool true
# Show SpaceID and hide the rest behind Dozer
# Show full time and date
defaults write com.apple.menuextra.clock DateFormat -string "\"EEE d MMM HH:mm:ss\""
# Mission Control
# ===============
# Disable automatic workspace re-ordering
defaults write com.apple.dock mru-spaces -bool false
# Desktop
# =======
# Disable desktop icons
defaults write com.apple.finder CreateDesktop false
# Mouse/Trackpad
# ==============
# Disable natural scrolling
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Disable scroll acceleration
defaults write NSGlobalDomain com.apple.scrollwheel.scaling -float 0
# Enable tap to click on trackpad
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Keyboard
# ========
# Disable auto correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Disable auto capitalisation
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
# Remove key repeat delay
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# Fast key repeat
defaults write NSGlobalDomain KeyRepeat -int 1
# Finder
# ======
# Show file extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles -bool true
# Show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Default to list view
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Keep folders on top
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Search current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Show Library
chflags nohidden ~/Library
# Activity Monitor
# ================
# Update very often
defaults write com.apple.ActivityMonitor UpdatePeriod -int 1
echo "[osconfig] INFO: Installation finished"