Skip to content

Ben-Voris/Mac-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mac usage notes

Function keys

How to use the function keys on your Mac either:

  • Press and hold the Function (Fn)/Globe while pressing a function key.
  • To change the default behavior of the keys
    1. Choose Apple menu  > System Settings.
    2. Click Keyboard in the sidebar.
    3. Click the Keyboard Shortcuts button on the right.
    4. Click Function Keys in the sidebar.
    5. Turn on “Use F1, F2, etc. keys as standard function keys”.

Keyboard shortcuts

Cut, copy, paste, and other common shortcuts

Much of this is from Mac keyboard shortcuts

  • Command + X: Cut the selected item and copy it to the Clipboard.
  • Command + C: Copy the selected item to the Clipboard. This also works for files in the Finder.
  • Command + V: Paste the contents of the Clipboard into the current document or app. This also works for files in the Finder.
  • Command + Z: Undo the previous command. You can then press Shift + Command + Z to Redo, reversing the undo command. In some apps, you can undo and redo multiple commands.
  • Command + A: Select All items.
  • Command + F: Find items in a document or open a Find window.
  • Command + G: Find Again: Find the next occurrence of the item previously found. To find the previous occurrence, press Shift-Command + G.
  • Command + H: Hide the windows of the front app. To view the front app but hide all other apps, press Option + Command + H.
  • Command + M: Minimize the front window to the Dock. To minimize all windows of the front app, press Option + Command + M.
  • Command + O: Open the selected item, or open a dialog to select a file to open.
  • Command + P: Open a print dialog so that you can print the current document.
  • Command + S: Save the current document.
  • Command + T: Open a new tab.
  • Command + W: Close the front window. To close all windows of the app, press Option + Command + W.
  • Option + Command + Esc: Force quit an app.
  • Command + Space bar: Show or hide the Spotlight search field. To perform a Spotlight search from a Finder window, press Command + Option + Space bar. (If you use multiple input sources to type in different languages, these shortcuts change input sources instead of showing Spotlight. (Learn how to change a conflicting keyboard shortcut.)
  • Control+ Command + Space bar or Fn + E: Show the Character Viewer, from which you can choose emoji and other symbols.
  • Control+ Command + F: Use or stop using the app in full screen, if supported by the app.
  • Space bar: Use Quick Look to preview the selected item.
  • Command + Tab: Switch to the next most recently used app among your open apps.
  • Command + ` (Grave accent): Switch between the windows of the app you're using.
  • Screen shots Learn more about screenshots.
    • Shift + Command + 5: In macOS Mojave or later, take a screenshot or make a screen recording.
    • Shift + Command + 3: Captures the entire screen and saves it to the desktop.
    • Shift + Command + 4: Captures a selection and saves it to the desktop.
  • Shift + Command + N: Create a new empty folder in the Finder.
  • Control+ Command + N: Create a new folder that contains the currently selected items.
  • Command + , (Comma): Open settings (preferences) for the front app.

More text editing keys

  • Delete: Deletes the character to the left, i.e., Linux backspace.
  • Fn + Delete: Delete the character to the right, i.e., Linux delete.

Moving on the line and up an down lines

These key chords behave different in different apps.

In VS Code, they move both the display and where text is inserted. In some documents, they seem to move based on document structure. For example, in this Markdown document, Control+ down-arrow can move to the last section and, in that case, pressing these keys a second time move to the bottom of the document.

In Notes, they move what text is displayed but do not move where text is inserted.

  • Fn + right-arrow: In VS Code, this moves the cursor to the end of line but in the Notes app, this displays the end of line but does not change the text insertion point.
  • Fn + left-arrow: Depends on the app, Moves the cursor to the beginning of the line.
  • Fn + down-arrow: Moves to the bottom of the window or document or, in VS Code and Safari, Page Down
  • Fn + up-arrow: Moves to the top of the window or document or, in VS Code and Safari, Page Up.

Create a line break in apps where Return means Send

  • Shift + Return Used in Signal and Messages

MacBook Trackpad setup

Settings > Trackpad

Remember to use both hands. For example, for me, swiping from the left is easier with the left hand. When selecting a large amount of text, it is possible to start the "click drag" with one hand and extend it with the other.

Point & Click

  • Set Click to Medium or Firm.
  • Enable Force Click and haptic feedback.
  • Set Look up & data detectors to Force Click with One Finger.
  • Set Secondary click (i.e., "right click") to Click with Two Fingers
  • Disable Tap to click. If this is enabled, a light tap is registered as a click.

Force click is a longish hard press that, if haptic feedback is enabled, gives a distinct "bump" as feedback.

An example of a "data detector" is a dictionary lookup that can appear when a word is selected that is in the dictionary. Sometimes this repeatedly does not work, even for words in the dictionary. And then it starts working.

Scroll & Zoom

Enable

  • Natural scrolling / Contents track finger movement
  • Zoom in or out / Pinch with two fingers
  • Smart Zoom / Double tab with two fingers
  • Rotate / Rotate with two fingers

More Gestures

  • Set Swipe between pages to Scroll Left or Right with Two Fingers
  • Set Swipe between full-screen applications to Swipe Left or Right with Three fingers
  • Enable Notification Center / Swipe left from the right edge with two fingers
  • Set Mission Control to Swipe Up with Three Fingers. This shows a set of small views of the currently running applications. Clicking on one brings that application to the foreground.
  • Set App Exposé to Swipe Down with Three Fingers This exposes the files opened by the current foreground application. Swipe up with three fingers to hide this.
  • Set Launchpad to Pinch with thumb and three fingers
  • Set Show Desktop to Spread with thumb and three fingers

Mouse command when editing text

  • In most apps (not VS Code), click on the word then Control + click to get suggestions.

Mouse command when reading text

  • Dictionary lookup can be enabled by turning System Settings > Trackpad > Force Click and haptic feedback on. To use this:
    • Three finger, long, hard press on a selected word.
    • NB: the three finger press must last long enough to cause the slightly delayed, "bump" feedback.
    • This works in VS Code, Safari, and Mail.

Apple Mail app

  • Option + Delete Deletes highlighted message without advancing to the next message.
  • Command + Shift + N: Refresh mailbox.
  • Two-finger left or right swipe on a message header exposes actions, like delete, mark as unread, etc.

NB: Something is leaving deleted messages in the inbox. They are marked as read. Wtf?

Messages app

  • Control + Click on a message: Displays options for tapback, edit message, delete, reply
  • Enter a line break.

Safari

  • Control + Click on a Link: Opens in a new tab
  • Two finger right swipe in tab: Closes tab
  • Command + Z: Undo close tab
  • Long press on + (new tab) shows recently closed tabs. Clicking on one reopens it.
  • Two finger swipe left and right on the trackpad are equivalent to the left and right arrows (Show the previous page and Show the next page).

VS Code

Keyboard shortcuts for macOS

  • Option + Command + F: Find and replace.
  • Shift + Command + \: Jump to the matching bracket
  • Control + G: Jump to line number
  • Command + K + S: Open Keyboard Shortcuts
  • Fn + F1 or Command + Shift + P: Open Command
  • Control + P: Previous line. Same as the up arrow key.
  • Control + N: Next line. Same as the down arrow key.
  • Page up, page down

VS Code steals the default minimize Command + M. I found no shortcut that uses only this, but some use it in conjunction with other keys, like Command + K + M for "Change Language Mode" and Shift + Command + M for "Toggle Problems".

Opening a file in VS Code from shell

open --new -a "Visual Studio Code" --args --new-window ~/.bashrc

It is necessary to tell open(1) to open a new window (--new) and to tell VS Code to create a new window --new-window.

OCR

This depends upon displaying the photo in the Preview app and so does not work for a photo that is in a shared album.

Interact with text in a photo using Live Text in Preview on Mac

From email

Double click on the picture to open the Preview app.

From Photos

  • Control + Click on the photo
  • Click on Edit With
  • Click on Preview (NB: you'll see a shortcut Command + Return. It doesn't work.)

Once in Previews

  • Tools > Text Selection
  • Use "drag" to select the desired text
  • Copy, e.g., with Command + C

Photo App

Keyboard shortcuts and gestures in Photos on Mac

This only works for a local photo and does not work for a photo in a shared album.

  • To add a title or subject, click on the i in the tool bar. A window will open. Click inside Title or Caption or Keywords, and type. Close the window.

What to install

Some iOS apps, like Feedly, Netflix, Youtube, etc. are not available for Mac. For these, visit the page, click on the Share (up arrow) and click on Add to Dock. Links that are added to the dock also appear in the Apps folder.

To install VS Code

https://code.visualstudio.com/download

Add these extensions

Bash IDE mads-hartmann.bash-ide-vscode
Bookmarks alefragnani.Bookmarks
C/C++ ms-vscode.cpptools
C/C++ Themes ms-vscode.cpptools-themes
markdownlint DavidAnson.vscode-markdownlint
Rewrap Revived dnut.rewrap-revived
Sort JSON objects richie5um2.vscode-sort-json
Sort lines Tyriar.sort-lines
Spell Right ban.spellright

Sign into GitHub.

To install exiftool

exiftool

  • macOS will display "Apple could not verify .... is free of malware ..." and will offer to "Move to Trash". Click Done.
  • Open System Settins > Privacy & Security
  • At the bottom, under Security, you should see the package you tried to install. Click on Open Anyway and the click on it again. Then enter your local password (not for the Apple account).
  • A window should open that lets you install the app, including changing the directory.

To install SQLLite browser

Download at https://download.sqlitebrowser.org

See https://github.com/sqlitebrowser/sqlitebrowser/.

To install Tor Browser

https://www.torproject.org/download/

To install Signal

https://signal.org/download/macos/

Existing chats from other devices are not synchronized.

To install Firefox

https://www.mozilla.org/en-US/firefox/mac/

To install DigiKam

A photo cataloging tool I used on Linux

https://www.digikam.org/download/

Installing this requires the same steps as exiftool.

Garmin programs

  • Garmin Basecamp for Mac
  • Garmin Express - Used this to update firmware on Alpha 100 GPS.
  • inReach Sync - Updates firmware. Also, syncs contacts and messages set in https://explore.garmin.com/Messages

Installed but not sure if they're useful

  • Garmin MapInstall
  • Garmin MapManager
  • Garmin WebUpdater for Mac - This should update the e-collars but gives a warning about running on a Mac.

From Mac App store

  • Amazon Prime Video
  • Orbit
  • Plain Paste
  • Speedtest
  • Strongbox
    • After installing it and Firefox, install its Firefox extension by opening https://addons.mozilla.org/en-GB/firefox/addon/strongbox-autofill/ in Firefox.
    • System Settings > Touch ID & Password set Use Touch ID for autofilling passwords on.
    • System Settings > Autofill from > AutoFill & Password, turn Passwords off and Strongbox on, and list Strongbox in Setup Code In
    • Verify that Strongbox is listed under Login Items & Extensions > Open at Login
  • Swift Playground
  • Xcode

Terminal app

Apple wants me to use zsh because it hooks into Apple thingies.

To avoid the annoying warning about zsh when starting bash, put this into ~/.zshenv:

# See https://support.apple.com/en-us/102360
export BASH_SILENCE_DEPRECATION_WARNING=1

Sometimes Control + C stops working and you'll hear a beep. When this happens, try Command + .

When you exit the shell, Terminal will stay running. To prevent this, in the Terminal settings Profiles, change "When the shell exits" to "Close if shell exited cleanly".

Accessing the Photo Library

Try pointing SQL Lite browser at database/Photos.sqlite.

The picture files are in "${HOME}/Pictures/Photos Library.photoslibrary/" The double quotes are necessary (that, or escape the space).

For one picture, with some edits, there are six files. See exiftool output for an example jpeg.

scopes/cloudsharing/data contains at least some (all?) of the photos from shared albums.

This command launches the Preview app from the zsh (not bash) command line:

open -a Preview -- "${HOME}/Pictures/Photos Library.photoslibrary/originals/0/0FB91698-EF23-48BF-96A9-F7902A77E118.jpeg

Things to check out for Photos

iCloud Photo downloader

To copy from iPhone to Mac or NAS PhotoSync – transfer photos on App store Visit photosync-app.com for a complete feature list.

Photo Exifer claims to import XMP data to the Photos app. See How to import XMP sidecars to Photos on Mac?

Photo Exifer is compatible with extensible metadata files, supporting XMP files from Apple Photos and JSON files from Google Photos. It allows you to read photo metadata from XMP and JSON files and write it back to the corresponding photos

Controlling the dock

These use defaults(1) to "access the Mac OS X user defaults system".

Prevent rearranging the dock

When using the trackpad, and the default configuration, I find it too easy to accidentally rearrange the dock. Here's a zsh command to prevent that.

defaults write com.apple.Dock contents-immutable -bool true; killall Dock

Allow rearranging the dock

defaults write com.apple.Dock contents-immutable -bool false; killall Dock

defaults can also be used to control whether one can change the docks's position com.apple.Dock position-immutable and size com.apple.Dock size-immutable.

Example of using defaults to read a value

defaults read com.apple.Dock contents-immutable

Homebrew vs. MacPorts

Homebrew and MacPorts are ways of getting open source tools running on a Mac. Both are actively maintained.

Here are Apple's ports

MacPorts and their mpstats tool installed quickly but the first real package I installed, shellcheck, took tens of minutes because it pulled so many dependencies - 465 packages per port echo rdepof:shellcheck - some of which did not have prebuilt binaries.

Thoughts on macOS Package Managers is in favor of MacPorts because it is more consistent with Linux and issues with how the project is run. Notes that Homebrew is sometimes updated more quickly. Though this is old, more recent pages link to it.

Responses to this Reddit lean towards Homebrew because it usually carries over with less between MacOS releases, though some note that can cause more problems than it fixes because Homebrew depends on the MacOS libraries. Also notes that its refusal to share /usr/local can cause problems.

MacPorts

Homebrew

List USB devices

system_profiler SPUSBDataType

Example output with Garmin e-collar attached:

USB:

    USB 3.1 Bus:

      Host Controller Driver: AppleT8132USBXHCI

        Vendor-Specific Device:

          Product ID: 0x0003
          Vendor ID: 0x091e  (Garmin International)
          Version: 0.01
          Speed: Up to 12 Mb/s
          Location ID: 0x03100000 / 1
          Current Available (mA): 500
          Current Required (mA): 500
          Extra Operating Current (mA): 0

    USB 3.1 Bus:

      Host Controller Driver: AppleT8132USBXHCI

    USB 3.1 Bus:

      Host Controller Driver: AppleT8132USBXHCI

ioreg -p IOUSB lists information about the USB controllers but I can't get it to display the attached device, as shown above.

Recording the screen / Screen capture a problem

How to record the screen on your Mac

Use the Screenshot app

  1. Open the Screenshot app by pressing these three keys together: Shift + Command + 5.
  2. You should see an onscreen toolbar with three controls for capturing a still image of your screen, followed by these two controls for recording a video of the screen:
    • Record Entire Screen
    • Record Selected Portion. You can adjust the selected portion by dragging its borders with your mouse or trackpad.
  3. Before starting your recording, you can click Options in the toolbar to change the recording settings:
    • To record your voice or other audio with the screen recording, choose a microphone.
    • To show a black circle around your pointer when you click, choose Show Mouse Clicks.
    • To set a recording timer, choose the number of seconds to wait before recording begins after you click Record.
    • To change where the recording will be saved after you stop recording, choose a different “Save to” location. By default, recordings are saved to your desktop.
  4. To start recording, click the Record button in the Screenshot toolbar.
  5. To stop recording, click the Stop button in the menu bar, or press Command-Control-Esc (Escape).
  6. When you see a thumbnail of the recording in the corner of your screen, click it to edit the recording. Or wait for the recording to save to your desktop.

Learn more about using the Screenshot app

Use QuickTime Player

  1. Open QuickTime Player from your Applications folder.
  2. From the menu bar, choose File > New Screen Recording. Or press Control-Command-N.
    • If you see the onscreen controls described above, screen recording on your Mac is performed by the Screenshot app. Follow the steps in the previous section.
    • If you see the Screen Recording window described below, screen recording on your Mac is performed by QuickTime Player. Continue to the next step.
  3. Before starting your recording, you can click the arrow next to the Record buttonNo alt supplied for Image to change the recording settings:
    • To record your voice or other audio with the screen recording, choose a microphone. To monitor that audio during recording, adjust the volume slider. If you get audio feedback, lower the volume or use headphones with a microphone.
    • To show a black circle around your pointer when you click, choose Show Mouse Clicks in Recording.
  4. To start recording, click the Record buttonNo alt supplied for Image and then take one of these actions:
    • Click anywhere on the screen to begin recording the entire screen.
    • Or drag to select an area to record, then click Start Recording within that area.
  5. To stop recording, click the Stop buttonNo alt supplied for Image in the menu bar, or press Command-Control-Esc (Escape).
  6. After you stop recording, QuickTime Player automatically opens the recording. You can now play, edit, or share the recording.

Learn more about using QuickTime Player

About

Ben's Mac notes

Resources

Stars

Watchers

Forks

Releases

No releases published