summaryrefslogtreecommitdiff
path: root/macos-defaults.sh
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-09-27 10:14:30 +0300
committerIgor Soarez <igor@soarez.org>2026-09-27 10:14:30 +0300
commitbf177c58da897dbd084cc1fe8e6ebd9b61b85830 (patch)
tree6024ee158efdb94856097a9bd42472074e6beb73 /macos-defaults.sh
parentb0714511e8557686cda9e0551324fd273a97e9b1 (diff)
macos: hot corners and tap to click, and a way to find the next key
Three settings this account has always set by hand on every new Mac, now in the script that exists for exactly that: the bottom-right hot corner sleeping the display, tap to click, and three-finger drag on an external trackpad -- the last a gap, since the script set it only for the built-in one. Each of those is written in more than one place because macOS keeps them in more than one place: an external Magic Trackpad has its own domain, and the login window reads com.apple.mouse.tapBehavior rather than either of them, per-host for this machine and globally for any other. Setting one and not the others is why tap to click sometimes survives a reboot and sometimes does not. bin/macos-defaults-diff is the general answer: snapshot, change one setting, and it prints what moved, including the -currentHost domains a plain `defaults read` never shows. It flushes cfprefsd first, since a change made seconds earlier can otherwise be missing from the read meant to reveal it, and it says plainly when nothing changed -- anything behind Privacy & Security lives in the SIP-protected TCC database and cannot be scripted at all.
Diffstat (limited to 'macos-defaults.sh')
-rwxr-xr-xmacos-defaults.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/macos-defaults.sh b/macos-defaults.sh
index c5830e8..c712069 100755
--- a/macos-defaults.sh
+++ b/macos-defaults.sh
@@ -34,11 +34,29 @@ defaults write com.apple.dock "tilesize" -int "46"
defaults write com.apple.dock "autohide" -bool "true"
defaults write com.apple.dock "show-recents" -bool "false"
+# Hot corners. 10 puts the display to sleep; the modifier is the key that must
+# be held, 0 for none. The others are left alone rather than set to "no action",
+# so a machine that has its own is not overruled. Values: 2 Mission Control,
+# 3 application windows, 4 desktop, 5 screen saver, 10 display sleep,
+# 11 Launchpad, 12 Notification Centre, 13 lock screen, 14 quick note.
+defaults write com.apple.dock "wvous-br-corner" -int 10
+defaults write com.apple.dock "wvous-br-modifier" -int 0
+
# Menubar date format
defaults write com.apple.menuextra.clock "DateFormat" -string "\"HH:mm\""
-# Three finger trackpad drag
+# Trackpad. Each of these is written in more than one place, and all of them
+# are needed: com.apple.AppleMultitouchTrackpad is the built-in trackpad,
+# com.apple.driver.AppleBluetoothMultitouch.trackpad an external Magic Trackpad,
+# and com.apple.mouse.tapBehavior is what the login window and new accounts
+# read -- per-host for this Mac, global as the default for any host.
defaults write com.apple.AppleMultitouchTrackpad "TrackpadThreeFingerDrag" -bool "true"
+defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad "TrackpadThreeFingerDrag" -bool "true"
+
+defaults write com.apple.AppleMultitouchTrackpad "Clicking" -bool "true"
+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 settings
# disable FN (globe key)