Skip to content

Instantly share code, notes, and snippets.

@dcchambers
Last active June 9, 2023 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcchambers/2ddfe75de16f922065a79589edadb68f to your computer and use it in GitHub Desktop.
Save dcchambers/2ddfe75de16f922065a79589edadb68f to your computer and use it in GitHub Desktop.
Improve your MacOS Experience

Fixes for Various Mac Issues

A couple of things that may improve your experience using MacOS.

Many of these settings can be configured via the command line (and thus, scripted) using the MacOS defaults tool.

defaults help
defaults read   # list all defaults
defaults write ...

Some defaults commands may require sudo

See also: https://macos-defaults.com/

Keyboard

Keypress Behavior

By default, in many contexts, holding a key will bring up the accent key options rather than repeat keystrokes. Disable this via command line:

defaults write -g ApplePressAndHoldEnabled -bool false

By default, mac has key repeat speed set quite low. In System Preferences --> Keyboard set Key Repeat to fast and Delay Until Repeat to short. Via the command line1:

defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)

Modifier Keys

If you are using a non-Apple keyboard, the default configuration probably swaps the CMD and OPTION/ALT keys from where they are on an apple keyboard. Change these in System Preferences --> Keyboard --> Modifier Keys

Audio

Bluetooth

You can improve bluetooth audio quality by forcing your device to use the aptXor AAC codecs.2

To enable aptX, enter this in your terminal:

defaults write bluetoothaudiod "Enable AptX codec" -bool true

To enable AAC, enter this in your terminal:

defaults write bluetoothaudiod "Enable AAC codec" -bool true

MacOS UI/UX

Dock

Hide dock automatically

defaults write com.apple.dock "autohide" -bool "true" && killall Dock
  • killall Dock restarts the Dock to apply the changes

Increase dock animation speed

defaults write com.apple.dock autohide-time-modifier -float 0.25 && killall Dock
  • To disable the animation entirely, use defaults write com.apple.dock autohide-time-modifier -int 0 && killall Dock
  • To restore the default behavior, set int value to 1 defaults write com.apple.dock autohide-time-modifier -int 1 && killall Dock

Disable magnify

  • In System Preferences --> Dock & Menu Bar

Misc

Enable click to drag from anywhere on a window. This setting, then hold CTRL+OPT+CMD, click anywhere on a window and drag to move it.3

defaults write -g NSWindowShouldDragOnGesture YES

More On MacOS Defaults

Footnotes

  1. https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x

  2. https://www.macrumors.com/how-to/enable-aptx-aac-bluetooth-audio-codecs-macos/

  3. https://twitter.com/nibroc/status/963088893758259200?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E963088893758259200%7Ctwgr%5E%7Ctwcon%5Es1_c10&ref_url=https%3A%2F%2Fwww.mackungfu.org%2FUsabilityhackClickdraganywhereinmacOSwindowstomovethem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment