macOS command line tricks and tips

Set the current user accounts profile photo (displayed on the login UI) using a local JPG image.

dscl . delete "${HOME}" JPEGPhoto
dscl . delete "${HOME}" Picture
sudo dscl . create "${HOME}" Picture "${PWD}/avatar.jpg"

Replace Time Machine with Volume on the menu bar

defaults write menuExtras -array \
  "/System/Library/CoreServices/Menu Extras/" \
  "/System/Library/CoreServices/Menu Extras/" \
  "/System/Library/CoreServices/Menu Extras/" \
  "/System/Library/CoreServices/Menu Extras/"

Show day of week, date time in 24H time in menu bar e.g. "13 Fri 16:49"

defaults write \
  DateFormat -string "d EEE HH:mm"
This is licensed under a Creative Commons cc-by-nc-sa International License