-
Notifications
You must be signed in to change notification settings - Fork 65
/
.macos
executable file
·34 lines (29 loc) · 1.25 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
#!/usr/bin/env bash
sudo -v
# Cron {{{1
# This needs full disk access enabled for the calling terminal emulator.
# E.g. Security & Privacy -> Full Disk Access -> iTerm.app
# Reference: https://gitlab.com/gnachman/iterm2/wikis/fulldiskaccess
if crontab -l 2>&1 | grep -qv english; then
{ crontab -l 2>/dev/null; echo "*/30 * * * * ~/bin/english-notification"; } | crontab -
fi
# Defaults {{{1
defaults write ApplePressAndHoldEnabled -bool true
defaults write NSGlobalDomain InitialKeyRepeat -int 20
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSRequiresAquaSystemAppearance -bool true
defaults write com.apple.finder AppleShowAllFiles -boolean true
defaults write com.google.Keystone.Agent checkInterval 172800
# Defaults (need disabled SIP) {{{1
if [[ "$(csrutil status)" =~ enabled ]]; then
echo 'Disable System Integrity Protection (rootless mode):'
echo ' * restart'
echo ' * hold cmd+R to boot into Recovery System'
echo ' * Utilities -> Terminal'
echo ' * $ csrutil disable'
echo ' * restart'
else
defaults write /System/Library/LaunchAgents/com.apple.mdworker.single LowPriorityBackgroundIO -int 1
defaults write /System/Library/LaunchAgents/com.apple.mdworker.shared LowPriorityBackgroundIO -int 1
fi
# vim: et sts=2 sw=2