DEV Community

Amir
Amir

Posted on • Edited on

MacOS Tips & Tricks

Table of Contents

  1. Charge Limiter
  2. Microsoft AutoUpdate
  3. Dock
  4. Menu Bar
  5. Brew
  6. Updating everything Automatically
  7. Useful Application
  8. ZSH
  9. Shortcuts
  10. The Power of Option key
  11. Common errors
  12. General Tips
  13. Useful Sites
  14. Other Resources

Charge Limiter

You can use one of these to limit how much your MacBook charges:

Make sure you read the readme file and know what you are doing. In most cases, you don't need this but if you are a pro user, you might like controlling it yourself.


Microsoft AutoUpdate

Disable opening popup every day (source)

sudo plutil -replace StartInterval -integer 864000 /Library/LaunchAgents/com.microsoft.update.agent.plist
sudo plutil -replace RunAtLoad -bool no /Library/LaunchAgents/com.microsoft.update.agent.plist
Enter fullscreen mode Exit fullscreen mode

Check for update manually (source)

/Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app/Contents/MacOS/msupdate -l
Enter fullscreen mode Exit fullscreen mode

Open GUI manually:

/Library/Application\ Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app
Enter fullscreen mode Exit fullscreen mode

Dock

Location of the setting file: /Users/[user-name]/Library/Preference/com.apple.Dock

Parameters description: https://developer.apple.com/documentation/devicemanagement/dock

Lock size of the dock

defaults write com.apple.dock size-immutable -bool true; killall Dock
Enter fullscreen mode Exit fullscreen mode

Lock position of the dock

defaults write com.apple.dock position-immutable -bool true; killall Dock
Enter fullscreen mode Exit fullscreen mode

Add empty item

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
Enter fullscreen mode Exit fullscreen mode

Revert to default

defaults delete com.apple.dock; killall Dock
Enter fullscreen mode Exit fullscreen mode

Menu Bar

In order to make it visible even in the fullscreen mode, you can go to System Preferences > Dock and Menu Bar and uncheck Automatically hide and show the menu bar in full screen

You can also set it individually for each app: (true means it will show it all the time in the fullscreen mode)

defaults write com.example.SomeApp AppleMenuBarVisibleInFullscreen -bool true
Enter fullscreen mode Exit fullscreen mode

💡 If you don’t know the app bundle identifier name, follow the first general tip.


Brew

Get the list of installed packages:

brew leaves
Enter fullscreen mode Exit fullscreen mode

Packages that I like to install:

cocoapods
composer
ffmpeg
gh
jq
openjdk
php
Enter fullscreen mode Exit fullscreen mode

Updating everything Automatically

Brew

brew update && brew upgrade && brew upgrade --cask
Enter fullscreen mode Exit fullscreen mode

Python packages (without package manager)

python3 -m pip install -U pip
pip3 list --outdated --format=json | jq -r '.[] | "\(.name)==\(.latest_version)"' | xargs -n1 pip3 install -U
Enter fullscreen mode Exit fullscreen mode

Check system updates

softwareupdate -l
Enter fullscreen mode Exit fullscreen mode

AppStore installed apps

brew install mas # install
mas outdated # show all the packages that need update
mas upgrade # update all of them
Enter fullscreen mode Exit fullscreen mode

Useful Application

Free/OpenSource:

  • Shottr → Screenshot / OCR / Scrolling Screenshot
  • AltTab → Window switcher with previews
  • Maccy → Clipboard manager
  • iTerm2 → Terminal emulator
  • LyricsX → Lyrics overly
  • HandBrake → Compress and convert video
  • AppCleaner → Uninstall apps
  • Amphetamine → Energy saver settings
  • Karabiner-Elements -> A powerful keyboard customizer
  • Yabai -> Tiling window management
  • MonitorControl -> Control external display's brightness & volume
  • MOS -> Smooth scrolling and set scroll direction
  • Raycast -> Better Spotlight
  • ImageOptim -> Reduces image file sizes
  • DBngin -> Database Version Management Tool
  • TablePlus -> Database management

CLI:

  • mas -> Mac App Store command line interface
  • YT-DLP -> Download video/audio from youtube

Paid:

  • BetterTouchTool -> Customize various input devices
  • Bartender -> Control and customize menu bar
  • Sound Source -> Sound control for apps and 3rd party monitors
  • MacUpdater -> Automatically track the latest updates of all applications installed
  • Movist -> Better video player

ZSH

Oh My ZSH install

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Configuration

ZSH_THEME="robbyrussell"
DISABLE_UPDATE_PROMPT="true"
HIST_STAMPS="yyyy/mm/dd"

plugins=(git extract zsh-autosuggestions)
Enter fullscreen mode Exit fullscreen mode

Useful Plugins (all)

# zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode

Shortcuts

  • Change volume in small increments: Shift ⇧ + Option ⌥ (alt) + Volume Up/Down
  • Change brightness in small increments: Shift ⇧ + Option ⌥ (alt) + Brightness Up/Down
  • Entering/Exiting fullscreen mode: fn + F
  • Paste without formatting: Command ⌘ + Option ⌥ (alt) + Shift ⇧ + V
  • Permanent deleting a file: Command ⌘ + Option ⌥ (alt) + Backspace
  • Show hidden files in Finder: Command ⌘ + Shift ⇧ + .

The Power of Option key

Do all of these when holding the Option key!

  • Hit the volume icon to see both input and output
  • Hit wifi icon to see every little detail
  • Hit menu bar items to see other options
  • Hit close window to close all instances of that application
  • Right click after you copied something to show Move item here instead of paste.
  • When seeing an image, Click on File > Save As while holding the option to convert your image to other formats. When selecting a format, hold the option to see more formats!

Common errors

  • App is damaged and can’t be opened. You should move it to the Trash.
sudo xattr -c /Applications/[name].app
Enter fullscreen mode Exit fullscreen mode

General Tips

1- Finding app bundle identifier:

osascript -e 'id of app "TextEdit"'
Enter fullscreen mode Exit fullscreen mode

2- Three-finger drag:

Go to System Preferences > Accessibility > Pointer Control > Trackpad options and then enable dragging with three finger drag. Now you can drag any window with three fingers.

3- Change drag & drop speed:

Go to System Preference > Accessibility > Pointer Control and change Spring-loading delay.


Useful Sites


Other Resources

Top comments (0)