-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacos.sh
executable file
·104 lines (75 loc) · 3.06 KB
/
macos.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
#! /usr/bin/env bash
#
# Configuring macOS preferences.
#
# @author Charlie Revett (@revcd).
echo "> starting macos.sh"
echo "> setting preferences"
# ------------------------------
# Dock & Menu Bar.
# ------------------------------
# Set Dock autohide delay.
defaults write com.apple.dock autohide-delay -float 0.5
# Enable Dock autohide.
defaults write com.apple.dock autohide -bool true
# Set datetime format in Menu Bar.
defaults write com.apple.menuextra.clock "DateFormat" -string "\"EEE d MMM HH:mm:ss\""
# ------------------------------
# Finder.
# ------------------------------
# Set Download as the default location for new Finder windows.
# Use `PfLo` and `file:///full/path/here/`.
defaults write com.apple.finder NewWindowTarget -string "PfLo"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Downloads/"
# Show hidden files.
defaults write com.apple.Finder AppleShowAllFiles true
# Use column view in all Finder windows by default.
# Four-letter codes for the other view modes: `icnv`, `Nlsv`, `clmv`, `Flwv`.
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
# ------------------------------
# General.
# ------------------------------
# Expand save panel by default.
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default.
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Disable smart quotes as they’re annoying when typing code.
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable smart dashes as they’re annoying when typing code.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# ------------------------------
# Keyboard.
# ------------------------------
# Decrease key repeat.
defaults write NSGlobalDomain KeyRepeat -int 1
# Decrease initial key repeat.
defaults write NSGlobalDomain InitialKeyRepeat -int 12
# Disable press-and-hold for keys in favor of key repeat.
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Disable auto-correct.
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# ------------------------------
# Screen.
# ------------------------------
# Save screenshots to specific folder.
mkdir ~/Pictures/Screenshots
defaults write com.apple.screencapture location -string "~/Pictures/Screenshots"
# Do not show the thumbnail of a screenshot.
defaults write com.apple.screencapture show-thumbnail -bool FALSE
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF).
defaults write com.apple.screencapture type -string "png"
# Require password immediately after sleep or screen saver begins.
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# ------------------------------
# Quitting apps.
# ------------------------------
echo "> quitting apps"
killall Dock
killall Finder
killall SystemUIServer
# ------------------------------
# Final.
# ------------------------------
echo "> note: now restart the machine"
echo "> complete"