-
Notifications
You must be signed in to change notification settings - Fork 0
/
macos
executable file
·99 lines (77 loc) · 3.47 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
#!/usr/bin/env bash
#
# MacOS tweaks for Yabai
# https://github.com/koekeishiya/yabai/wiki#quickstart-guide
set -eEuo pipefail
# make Homebrew/personal installed apps visible to GUI apps (like Spotlight)
# https://docs.brew.sh/FAQ#my-mac-apps-dont-find-usrlocalbin-utilities
if [[ -f /private/var/db/com.apple.xpc.launchd/config/user.plist ]] ; then
launchctlUserPath="$(plutil -convert json -o - -r /private/var/db/com.apple.xpc.launchd/config/user.plist \
| jq -r '.PathEnvironmentVariable')"
# TODO check if paths are already in launchctlUserPath
sudo launchctl config user path "/usr/local/bin:$launchctlUserPath"
if [[ -d "$HOME/bin" ]] ; then
sudo launchctl config user path "$HOME/bin:$launchctlUserPath"
fi
fi
# 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'
# Enable the 'reduce transparency' option on Yosemite. Save GPU cycles.
# FIXME changed name on Monterey?
#defaults write com.apple.universalaccess reduceTransparency -bool true
# Enable the 'reduce motion' option. Faster Space switching
# FIXME changed name on Monterey?
#defaults write com.apple.universalaccess reduceMotion -bool true
## Fix folder opened from desktop not tiling in
defaults write com.apple.finder DisableAllAnimations -bool true
# to reset system defaults, delete the key instead
# defaults delete com.apple.finder DisableAllAnimations
## Dock
# Remove the auto-hiding Dock delay
defaults write com.apple.dock autohide-delay -float 0
# Extend the auto-hiding Dock delay
defaults write com.apple.dock autohide-delay -float 3
# 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
# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
## Desktop
# hide all icons
defaults write com.apple.finder CreateDesktop -bool false ; killall Finder
## Spaces
# Don’t automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
# Displays have separate Spaces
# FIXME seems to be an int on Arm
defaults write com.apple.spaces spans-displays -bool true
# Wipe all (default) app icons from the Dock
# This is only really useful when setting up a new Mac, or if you don’t use
# the Dock to launch apps.
#defaults write com.apple.dock persistent-apps -array
## Menubar
# autohide menubar, since we're using Spacebar
defaults write NSGlobalDomain _HIHideMenuBar -bool true
# Shortcuts
#
# see: https://support.apple.com/en-us/HT201236
#
# The meta-keys are set as
# @ for Command
# $ for Shift
# ~ for Alt
# ^ for Ctrl.
# 'k' in this example is the non-meta-key that you want to use.
# '\\U2026' is the code for an elipsis, useful in menu items
#
# For Application-specific commands, use the following:
# defaults write com.developer.app NSUserKeyEquivalents -dict-add "Menu Item" -string "@$~^k"
# For system-wide shortcuts, you can use -g instead of the app identifier, e.g.
# defaults write -g NSUserKeyEquivalents -dict-add "Menu Item" -string "@$~^k"
#
# Note that you'll need to relaunch the app before these will take effect. Also
# you can see if they've been successful in System Preferences -- which will also
# need a relaunch to show the changes.
echo "Done. Note that some of these changes require a logout/restart to take effect."