workstation ⚙️ macOS  - martindubenet/wed-dev-design GitHub Wiki

💡 Mac tips & tricks

  1. Safari
    • ⌘Command+L : Set focus in address bar.
  2. Search
    • ⌘Command+Spacebar : Opens Spot light (floating window) to search on macOS.
    • ⌥Option+⌘Command+Spacebar : Opens the Search field within Finder window.
  3. Color picker
    1. ꜛSHIFT+⌘Command+C : Copy color values as text. More about Digital Color Meter native app is available on support.apple.com.
  4. Text inputs
    • Toggle keyboard’s input sources languages using one of those two options:
      (request to enable shortcut in Keyboard settings)
      • fn⬆ (when NOT within a text editor),
      • If within a text editor ⮕ ⌃Ctrl+⌥Option+Spacebar
    • Emoticons 🎭👉 ⌃Ctrl+⌘Command+Spacebar
  5. Toggle view
    • fn⬆+F11 : Toggle from the actual view to Desktop and back.
    • ⌘Command+↦Tab : Navigate through open apps.
    • ⌘Command+h : Hide the active window.
  6. Finder
    • ⌥Option+⌘Command+Spacebar : Focus on the Search field within Finder window.
    • ꜛSHIFT+⌘Command+. : Toggle system’s HIDDEN FILES visibility.
    • ꜛSHIFT+⌘Command+g : Opens the « GO TO FOLDER » window.
    • ⌘Command+J : Show View Options
      • Check✅ Calculate all sizes : Displays FOLDER SIZE in Finder’s Sizes columns
      • Check✅ Show Library folder : Turns Library visible in the list.
  7. Notifications
    • Click on the date and time to toggle the Notifications window.
    • Scroll down the Notifications window and click on Edit Widgets to customize the view to your needs.
  8. Mail
  9. Screenshot on Mac
    • ꜛSHIFT+⌘Command+3 : Captures the entire screen.
    • ꜛSHIFT+⌘Command+4 : Captures a portion of the screen.
    • ꜛSHIFT+⌘Command+4+Spacebar : Captures the active window (or menu).
    • ꜛSHIFT+⌘Command+5 : Take pictures or screencast using the Screenshot app.
    • ꜛSHIFT+⌘Command+6 : Captures the MacBook Pro Touch Bar.

Screenshuts and Screenrecordings

Try Shottr free app with incorporated features like ruler, pixelate area, remote saves, etc.

By default the screenshuts are saved within ~/Documents/Screenshots/ as Screen Shot YYYY-MM-DD at HH.MM.SEC.png. How to change where screenshots are saved on macOS

Native screen recordings (or screencasts) are saved within the (hidden by default) «User's Library» under ~/Library/ScreenRecordings/. Keep an eye on this folder size because it gets huge very fast.

iMovie default projects repository

  • ~/Movies/iMovie Library.imovielibrary/*

Fix the « dot_ » file polution generated by osx duplicated gost files.

find . -type f -name '._*' -delete

apple.stackexchange.com: dot_clean

Key boards

These hidden characters are SO useful to get when you’re stuck with a keyboard layout that those not match the active language you are typing in.

Mac « Canadian English » input keyboard layout

Combination Character Description
⌥Option+7 Paragraph character
⌥Option+8 Bullet character (unordered list icon)
ꜛSHIFT+⌥Option+8 ˚ Degree character
ꜛSHIFT+⌥Option+= NOT equal
⌥Option+Q œ French character
ꜛSHIFT+⌥Option+Q Œ Uppercase french character
⌥Option+E ´ French acute accent symbol.
Do not confuse with “right single quotation mark” ()
(fr: Symbole d’accent aigu)
⌥Option+I ˆ French circumflex accent
⌥Option+[ Left curly opening double quotes
⌥Option+] Left curly opening single quote
⌥Option+\ « Opening french citation quotation mark
(fr: Guillemet d’ouverture de citation)
ꜛSHIFT+⌥Option+\ » Closing french citation quotation mark
(fr: Guillemet de fermeture de citation)
ꜛSHIFT+⌥Option+K Mac OS icon
⌥Option+G © Compyrights character
ꜛSHIFT+⌥Option+G ˝ Right double quotes
⌥Option+; Hellips
⌥Option+/ ÷ Division
⌥Option+C ç French character
ꜛSHIFT+⌥Option+C Ç Uppercase french character

Mac « Canadian French - CSA » input keyboard layout

Opening bracket Characters Closing bracket
⌥Option+7 { } ⌥Option+8
⌥Option+9 [ ] ⌥Option+0
⌥Option+, < > ⌥Option+.
⌥Option+Z « » ⌥Option+X
Combination Character Description
⌥Option+2 @ Commercial AT sign
(fr: Arobase)
⌥Option+P Left curly opening double quotes
⌥Option+Ç ~ Tilde
⌥Option+; ° Degree
⌥Option+^ ` Escaping code, back tilde

For more characters visit the « HTML characters cheatcheat »

Access write issue in Terminal

When you don't have Read & Write privileges on a file you may get Permission Denied message in the Terminal. Then simply run the “chmod 777” command line to allow access to the file.

chmod 777 example.txt

Batch renaming files or folders from Finder

  1. Select one or multiple files or folders,
  2. ⌃Ctrl+🖱Click,
  3. Select « Rename » from the contextual menu.

See renaming options and examples.

Internet speed test from Terminal

This Terminal command will run the download speed test first and then check your upload speeds.

networkQuality -s

Keyboard languages in Menu bar

Open With

Useful tutorial about how to open anything in VS Code using a MacOS Quick Action.

Volumes

In the Mac/Linux operating systems we refer to Volumes instead of Drives as we do on Windows PC.

Terms Windows macOS / Linux
Hard disk Drive Volume
Default disk C:\ /Volumes/Macintosh HD

How to move files or folders using the Linux mv command.

Symlinks

A « symbolic link », aka soft link or symlink, is a special kind of file that points to another file. A shell alias allows a string to be substituted for a word when it is used as the first word of a simple command.

This is useful for storing your apps files on your remote SSD drive without changing the default setup of those (Hello Adobe!) apps.

ln -s /Original Folder /Destination Folder

Example

ln -s /Volumes/YourRemoteDriveName/Projects ~/Projects

 

 

⚙️ Setup your Mac

In macOS the naming convention cascade:

  • Finder : « {{💻Computer name}} / Macintosh HD / Users / {{🏠Username}} »,
  • Terminal : « {{⎆Local network name}} … {{🏠Username}}$ » as prefix to every new line.

Better choose a short database safe name (PascalCase or chamelCase) for your {{⎆Local network name}} since it will be used for Terminal lines prefix and probably some log reports.

 

⚙️ Preferences

Peripherals

In Mac wording, keyboard key's language layout refers to keyboard input sources.

  • System Preferences ➥ Keyboard ➥ Shortcuts : At the bottom, Check✅ Use keyboard navigation to move focus between controls
  • System Preferences ➥ Keyboard ➥ Shortcuts ➥ Input Sources :
    • Check✅ Select the previous input source,
    • Check✅ Select next source in Input menu,
  • System Preferences ➥ Mouse : Check✅ Scroll direction: Natural.
  • System Preferences ➥ Trackpad ➥ Scroll & Zoom : Uncheck⬜ Scroll direction: Natural.

System preferences

  • System Preferences ➥ General ➥ Sharing ➥ Computer name : {{💻Computer name}} (used in Finder’s sidebar).
  • System Preferences ➥ General ➥ Sharing ➥ Local hostname ➥ Click [Edit] : {{⎆Local hostname}}.
  • System Preferences ➥ General ➥ Language & Region ➥ Preferred languages : (1st) English (Canada) Primary then (2nd) French (Canada) CSA.
  • System Preferences ➥ Users & GroupsUnlock👆🔓 ➥ Guest User : Check✅ Allow guests to log in to this computer.
  • System Preferences ➥ Internet AccountsSet your iCloud, Apple Game Center, Microsoft Exchange and/or Gmail accounts.

Finder preferences

  1. To display the path of the CURRENT FOLDER LOCATION within the Finder’s header, copy/paste the following command line in Terminal:
    defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES && killall Finder
  2. Finder Preferences ➥ Sidebar ➥ Show these in sidebar:
    • Favorites ➥ Check✅ Applications
    • Favorites ➥ Check✅ Downloads
    • Favorites ➥ Check✅ {{🏠Username}}
    • Locations ➥ Check✅ {{💻Computer name}}
    • Locations ➥ Check✅ Hard disks
    • Locations ➥ Check✅ External disks
  3. Finder Preferences ➥ Advanced:
    • Check✅ Show all filename extensions
  4. Finder ➥ View ➥ Show View Options (⌘Command+J)
    • In the Info window, Check✅ Calculate all sizes : This will display the folder’s cumulative contents weight to display in the Finder’s Sizes columns.

Set Apple media libraries on an external Hard Drive

You're gonna regroup all the three Apple medias, (iMovie) Movies, Music and Pictures libraries location on your remote USB 4 Thunderbolt compliant USB-C driver to keep precious space on your Mac's native HD exclusively for your application's files.

  1. First create a dedicated « Apple Media Libraries files » at the root of your remote driver where all your media libraries will be located,
  2. From Finder Settings's Sidebar tab, make sure that all 3 medias are checked to be visible in Sidebar,
  3. Drag and Drop each of the following repository file from their original location to their new common folder.
Video tutorials

Photo library ➥ Preferences

  1. Move your Photos library to save space on your Mac
  2. Designate a System Photo Library in Photos

Safari ➥ Preferences

Toggle the « (hover) Status Bar » : Safari App ➥ View ➥ Show/Hide Status Bar ⌘Command+/

  1. Make the entire URL visible within the Address Bar :
      Safari Preferences ➥ Advanced ➥ Smart Search Field : Check✅ Show full website address.
  2. Show access tools for developing websites :
      Safari Preferences ➥ Advanced : Check✅ Show Develop menu in menu bar.

Terminal ➥ Preferences

  1. General ➥ New window profile : Homebrew.
  2. General ➥ Shells open with : Command (complete path) : /bin/zsh (IF you want Bash replace by /bin/bash).
  3. General ➥ Check✅ Use ⌘-1 through ⌘-9 to switch tabs.

Terminal shell : Zsh VS Bash

Since macOS Catalina, Apple is now using Zsh as the default shell. Zsh is only the default shell on newly created user accounts, so any existing accounts you have on an upgraded Mac will still use Bash by default unless you change it. Each user account has its own default shell preference.

Know what shell is active :

echo $SHELL

Toggle Terminal shell from Terminal :

# Switch to Bash
chsh -s /bin/bash

# Switch to Zsh
chsh -s /bin/zsh

Code Zsh Terminal | Upgrading Bash on macOS

Add custom aliases in Terminal

See this documentation on how to customize your Zsh Terminal

My git repositories

cd /Volumes/usbT7r/Projects/www/

Audio set-up for multiple external microphones

Using the utility app « Audio MIDI Setup » allows us to connect multiple audio input source at once by creating a custom Aggregated Device that we then use in the app where needed.
Create Aggregate Device

 

⚙️ Setup Macs running on Apple Silicon ARM64 processor for development

Except for Rosetta 2 most of these instructions are for a developer's workstation.

To install Rosetta 2 copy/paste the following command within the Terminal:

softwareupdate --install-rosetta

About brew

Homebrew is a package manager for macOS. It is one of the first tools you'll need to set up a local development environment for programming on a Mac. Use it to install (and remove) software programs for the terminal, or command line. It is like an app store for programming tools (but everything is free). Learn more : « Install Homebrew » by Daniel Kehoe.

For macOS on Apple Silicon ARM64 the $PATH has been changed to /opt/homebrew/ and since December 1st 2021 the brew cask now: brew.

Is Homebrew already installed?

  1. Check the following folders
    1. ls /usr/local
    2. ls /opt/homebrew
  2. If the following folders exists and contains stuff,
    1. If this is your case that means Homebrew is installed. Just run «brew update» to get the latest version.
  3. If the folders do NOT exists,
    1. Check your Xcode app local : xcode-select -p. IF the path contains «white spaces» update to the latest version or simply delete it. Because white spaces will make the Homebrew installation problematic.
    2. Go to next step « Install Homebrew ».

If your own an Silicon ARM64 equipped workstations you should consider properly uninstallling Xcode from your computer BEFORE installing Homebrew. It seems to be the source of installation problems EVEN if the path of it’s location does not contains «white spaces».

Anyway the Homebrew installer includes the installation of missing «Xcode Command Line Tool (CMT)» in it’s script.

Run the following command line (as proposed on the official website: https://brew.sh)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
For Silicon ARM64 equipped workstations :

Those 3 hidden files located under «/Users/{{username}}/» containing specific path are required since Homebrew version 3 (December 2021).

Hidden file Command line to create it Should contain this
.bash_profile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile eval "$(/opt/homebrew/bin/brew shellenv)"
.zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"
.zshrc echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc export PATH="/opt/homebrew/bin:$PATH"

At the end these brew lines should now print something.

  1. brew doctorshould print:

    Your system is ready to brew

  2. brew list should print the apps you installed via Homebrew,
  3. brew help should print many paragraphs of info.

#3 Xcode

You can either install the full Xcode IDE available on developer.apple.com/xcode or, if you want to save space on your drive, install only the Xcode CLT.

Install Xcode Command Line Tool (CLT) via this command line in your Terminal

xcode-select --install

Update to latest Xcode IDE version

To update to lastest version of Xcode Command Line Tools the easiest way is by first removing the old version of the tools then runing the install command line.

  1. Remove the existing CommandLineTools
    sudo rm -rf /Library/Developer/CommandLineTools
  2. Go to System Settings > Software Update. Under the Updates Available section you should see« Command Line Tools for Xcode »

    Click the button « Update Now ».

  3. Return to the Terminal and type this command
    xcode-select -p
  4. After receiving this message « /Applications/Xcode.app/Contents/Developer » [+] type this command
    sudo xcode-select --switch /Library/Developer/CommandLineTools

If unsuccessful, get the .dmg file from the download link below.

developer.apple.com/download : Command Line Tools for Xcode

#4 Use Homebrew to install these globally

  1. Java :
  2. NodeJS :
    brew install node
  3. Dart Sass :
    brew install sass/sass/sass
  4. Git :
    brew install git
  5. ESLint
    brew install eslint

#5 Install others

Here is my list of « Useful workstation tools »

Check your installed global stack:

globals local path
Homebrew /opt/homebrew/
Installed via brew /usr/local/
npm /usr/local/lib/node_modules/npm/node_modules/

 

⏳ Productivity apps

Required apps for web developers

  1. Microsoft Visual Studio Code

Recommended apps

  1. Alfred
  2. Audacity with the FFmpeg plugin (install via Terminal: brew install ffmpeg)
  3. Magnet
  4. Paste Plain Text : Pasting clipboard copied text as plain text, available right from the top menu bar.
  5. PDFpen $ : (available within SetApp package).
  6. Skitch : A companion app for Evernote. Better then the native Preview app for screenshots. Available on iOS devices.

Worth mentionning apps

  • Gemini $ : Find and manage file duplicatas on your station.
  • Spark $ : Mail reader that includes TEAM CHATS associated with a "by email" silos.
  • Markdown note taker :
    • Obsidian on both macOs and iOS devices.
    • Tot $ on iOS, Free on macOS : Cloud note taking micro-app accross all Apple devices and support Markdown.md format.

Mac system overview :

  • iStat Menus $ : Minimalistic Mac system overview. (Or see Sensei below for a more advance app)
  • Sensei $ : All in one Mac system overview that comes with the included Trim Enabler app that allow SSD disc maintenance.
⚠️ **GitHub.com Fallback** ⚠️