Skip to content

Instantly share code, notes, and snippets.

@federicoiosue
Last active July 17, 2024 08:47
Show Gist options
  • Save federicoiosue/8da3001db4d6424cfb5b3eaf371675fd to your computer and use it in GitHub Desktop.
Save federicoiosue/8da3001db4d6424cfb5b3eaf371675fd to your computer and use it in GitHub Desktop.
MacOS customizations & tips

Configuration tweaks

Mouse scroll action

defaults write com.apple.dock scroll-to-open -bool TRUE; killall Dock

Clock shown as analog icon into menu bar

defaults write com.apple.menuextra.clock IsAnalog -bool true

Show hidden files in Finder

defaults write com.apple.finder AppleShowAllFiles YES

Enable SSH with keychain auth and permanently add identity

echo $'Host * \n  UseKeychain yes \n  AddKeysToAgent yes \n  IdentityFile ~/.ssh/id_rsa' >> ~/.ssh/config

Disable enlarge animation of windows

defaults write -g NSWindowResizeTime -float 0.003
Re-enables defaults
delete -g NSWindowResizeTime

Disable ReportCrash

https://ss64.com/osx/reportcrash.html

launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist

Change default dir for screenshots

mkdir -p ~/Pictures/Screenshots && defaults write com.apple.screencapture location ~/Pictures/Screenshots && killall SystemUIServer

Launchpad icons size

defaults write com.apple.dock springboard-rows -int 4 && defaults write com.apple.dock springboard-columns -int 4 && killall Dock
Restore
defaults write com.apple.dock springboard-rows && defaults write com.apple.dock springboard-columns && killall Dock

Menu bar items squeezed

https://developer.apple.com/documentation/appkit/nsstatusitem

defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 5
defaults -currentHost write -globalDomain NSStatusItemSpacing -int 5

Trackpad drag

System Preferences → Accessibility → Pointer Control → Mouse & Trackpad → Trackpad Options link

Middle touchpad click to close items

https://github.com/cl3m/MiddleClick

Enable CMD+Q check in Chrome to avoid wrong quit

Click "Chrome" in the menu bar and check the "Warn Before Quitting"

xcode cli install on system upgrade

xcode-select --install

Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask
brew tap buo/cask-upgrade

Configuration

Backup & Restore

Restore previously saved bundle dump (howto)

brew bundle --file=~/Brewfile-20200531

Avoid Homebrew updating database aaaaall the times

echo "export HOMEBREW_NO_AUTO_UPDATE=1" >> ~/.bash_profile

Easy app upgrade with Homebrew & Mas

echo "alias brewup='brew -v update; brew -v upgrade; brew -v cask upgrade; mas upgrade; brew -v doctor; brew -v cleanup'" >> ~/.aliases

Common apps

brew cask install authy gimp spotify the-unarchiver vlc

# Limit Spotify cache size
echo "storage.size=512" >> "/Users/fiosue/Library/Application Support/Spotify/prefs"

# Browsers
brew cask install google-chrome
brew cask install brave-browser

# Messaging
brew cask install telegram
brew cask install whatsapp
brew cask install microsoft-teams

Tweaking apps

brew cask install vanilla licecap coconutbattery scroll-reverser monitorcontrol

CLI apps

brew install nmap htop watch tree multitail ffmpeg tree wget ncdu

Development apps

brew install maven gradle node git git-flow-avh svn mysql-client jq swaks

brew install --cask iterm2 docker postman gitkraken sublime-text virtualbox virtualbox-extension-pack drawio

# Docker fix insicure registry
https://stackoverflow.com/a/39492340

# GPG commits signature
brew install gnupg pinentry-mac
echo "pinentry-program $(which pinentry-mac)" >> ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent

Terminal Enhancements

brew install fortune cowthink zsh zsh-completions zsh-syntax-highlighting zsh-autosuggestions
font-meslo-for-powerline

Multiple SSH shell

brew tap parera10/csshx
brew install parera10/csshx/csshx

Mac App Store

If some previously purchased software from the Mac App Store needs to be included, we can use mas to ease the installs.

brew install mas

# Amphetamine
mas install 937984704

# Microsoft Word
mas install 462054704

# Microsoft Excel
mas install 462058435

# Spark email client
mas install 1176895641

# Skitch
mas install 425955336

Switch comma to dot into numpad

brew install karabiner
# Then enable "Swap Dot and Shift+Dot"

Various

Java with SDKman

Link

curl -s https://get.sdkman.io | bash
sdk install java 8.0.275.j9-adpt && sdk home java 8.0.275.j9-adpt
sdk install java 

IntelliJ <-> Android Studio keymaps

cp "/Users/fiosue/Library/Preferences/IntelliJIdea2018.2/jba_config/mac.keymaps/feio _Eclipse Mac OS X_.xml" "/Users/fiosue/Library/Preferences/AndroidStudio3.2/keymaps/feio _Eclipse Mac OS X_.xml"

Xcode toolkit

xcode-select --install

NTFS R/W auto-mount

https://medium.com/@vsulak.svk/enabling-ntfs-write-in-macos-10-15-catalina-the-open-source-way-a5fd0d1cb32e

Scanner & printers

AirPrint drivers could not correctly detect scanner feature. If so use the native driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment