Skip to main content

8 posts tagged with "macOS"

View All Tags

Disable automatic macOS sleep

Sleeping on macOS messes up Thunderbolt USB devices, so I just can't have it happening.

sudo pmset -a sleep 0

For good measure, also enable "Prevent automatic sleeping when the display is off" under System Settings > Energy

Show/hide macOS Dock faster

To show the macOS app switcher on all screens:

defaults write com.apple.dock autohide-delay -int 0
defaults write com.apple.dock autohide-time-modifier -float 0.1

To see the change, restart the Dock with killall Dock.

Show macOS app switcher on all screens

To show the macOS app switcher on all screens:

defaults write com.apple.dock appswitcher-all-displays -bool true

To see the change, restart the Dock with killall Dock.

SoundSource freezing

I can't use macOS anymore without SoundSource. However, it frequently freezes, hangs, crashes, etc. This requires a not-too-lengthy but still annoying manual flow of opening up Activity Monitor to force kill it, then opening it again. So I made it easier and automated.

Use Touch ID for sudo on macOS

Add the line

auth       sufficient     pam_tid.so

at the top of /etc/pam.d/sudo (you will need sudo access to write to that file).

You'll need to do this after at least every OS update as that file gets overwritten in those updates.

Here's a single command you can run to accomplish this:

sudo sed -i '' '2i\
auth sufficient pam_tid.so
' /etc/pam.d/sudo

Making Your Terminal Awesome

The tools we use as developers make us more effective (or at least hopefully faster) developers. So why not spend some time to make one of the most common dev tools much more useful? Here's a way to give any terminal app a personalized and awesome experience (fwiw I use the default app included with macOS). Features covered will be the following:

  • a super informative and customizable prompt
  • per-directory prompt customization
  • automatic switching of Node.js versions (easily extended to any run-time)
  • better auto complete and history
  • optional "command done" chime