/macOSuckless

Scripts, commands, hacks, and tweaks to make macOS suck less.

macOSuckless

This document is a list of scripts, commands, hacks, and tweaks to make macOS suck less.

Finder Tweaks

Disable .DS_Store files

macOS 10.8-10.10

#!/usr/bin/env bash
if [[ -n `csrutil status | grep "disabled"` ]]; then
  brew cask install asepsis
else
  echo "You must disable System Integrety Protection to install Asepsis.\nReboot into recovery mode (Command+R during startup) and run 'csrutil disable' from Terminal while in recovery mode." && exit 1
fi

Delete .DS_Store files

macOS 10.12+

#!/usr/bin/env bash
sudo find / -name *.DS_Store -depth -exec rm {} \;

Use column view as default

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.Finder FXPreferredViewStyle Nlsv

Show file extensions

macOS 10.12+

#!/usr/bin/env bash
defaults write -g AppleShowAllExtensions -bool true

Show hidden files

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder AppleShowAllFiles true

Unhide Library folder

macOS 10.12+

#!/usr/bin/env bash
chflags nohidden ~/Library

Open new Finder windows in home directory

macOS 10.12+

#!/usr/bin/env bash
defaults read com.apple.finder NewWindowTargetPath -string file:///Users/`whoami`

Search current folder by default

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder FXDefaultSearchScope -string SCcf

Show directory info

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

Show tab bar

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder ShowTabView -bool true

Don't show mounted volumes on Desktop

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false

Show preview pane

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder ShowPreviewPane -bool true
defaults write com.apple.finder PreviewPaneWidth -int 172

Set sidebar width

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder SidebarWidth -int 172

Better sidebar defaults

SFL storage is located in ~/Librarsysy/Application\ Support/com.apple.sharedfilelist/

sfltool (included with macOS) and mysides (https://github.com/mosen/mysides) can by used to a limited extent on macOS 10.12, however 10.13 will require more advanced scripting via the XPC interface (see: https://stackoverflow.com/questions/1062856/how-do-you-programmatically-put-folder-icons-on-the-finder-sidebar-given-that-y/16769092#16769092).

macOS 10.12

#!/usr/bin/env bash
user=`whoami`
mysides remove All\ My\ Files file:///System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/
mysides remove iCloud x-apple-finder:icloud
mysides remove domain-AirDrop nwnode://domain-AirDrop
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user/Desktop
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user/Documents
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user/Downloads
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user/Movies
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user/Music
sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/$user/Pictures
PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled bool False" /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.bonjourEnabled bool False" /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
killall cfprefsd
killall Finder

Show connected servers in sidebar

macOS 10.11

#!/usr/bin/env bash
defaults delete com.apple.sidebarlists networkbrowser
defaults write com.apple.sidebarlists networkbrowser -array-add '<dict><key>CustomListItems</key><array/><key>CustomListProperties</key><dict><key>com.apple.NetworkBrowser.connectedEnabled</key><true/><key>com.apple.NetworkBrowser.bonjourEnabled</key><false/><key>com.apple.NetworkBrowser.backToMyMacEnabled</key><true/></dict><key>Controller</key><string>CustomListItems</string></dict>'

Restart Finder and Dock

macOS 10.12+

#!/usr/bin/env bash
killall Finder
rm ~/Library/Application\ Support/Dock/*.db
killall Dock

Usability Tweaks

Expand Save Panel by default

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true
defaults write -g NSNavPanelExpandedStateForSaveMode2 -bool true

Set Dock size and make it unchangeable

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock tilesize -int 48
defaults write com.apple.dock size-immutable -bool true
killall Dock

Dim Dock icon when application is hidden

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock showhidden -boolean true
killall Dock

Make Dock empty (removes all current icons)

macOS 10.12+

#!/usr/bin/env bash
defaults delete com.apple.dock persistent-apps
killall Dock

Add a blank space to the end of Dock

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
killall Dock

Speed up LaunchPad animations

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock springboard-show-duration -float 0.1
defaults write com.apple.dock springboard-hide-duration -float 0.11
defaults write com.apple.dock springboard-page-duration -float 0.1

Change layout of LaunchPad

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock springboard-columns -int 8
defaults write com.apple.dock springboard-rows -int 12
defaults write com.apple.dock ResetLaunchPad -bool true

Don't sort Mission Control Spaces by most recent use

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock mru-spaces -bool false

Input Tweaks

Disable natural scroll direction

macOS 10.12+

#!/usr/bin/env bash
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
echo "You may have to logout and log back in for this change to take effect."

Use keyrepeat instead of special character insert dialog on press-and-hold

macOS 10.12+

#!/usr/bin/env bash
defaults write -g ApplePressAndHoldEnabled -bool false
defaults write -g InitialKeyRepeat -float 50
defaults write -g KeyRepeat -float 1

System Tweaks

Make macOS less intrusive/annoying.

Allow Applications to be installed from anywhere

macOS 10.12+

#!/usr/bin/env bash
sudo spctl --master-disable

Make crash reporter appear as a notification instead of a floating window (less annoying)

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.CrashReporter UseUNC 1

Disable shadows on window screenshots

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer

Performance Optimizations

Speed up some aspects of OS X.

Links:

Disable smooth scrolling

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSScrollAnimationEnabled -bool false

Disable animations when opening and closing windows

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false

Disable animations for Quick Look windows

macOS 10.12+

#!/usr/bin/env bash
defaults write -g QLPanelAnimationDuration -float 0

Speed up window resize animations (fullscreen, etc.)

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSWindowResizeTime -float 0.001

Disable animation when opening the Info window in Finder

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.finder DisableAllAnimations -bool true

Disable animations when you open an application from the Dock.

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock launchanim -bool false

Make all animations faster that are used by Mission Control.

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock expose-animation-duration -float 0.1

Disable animation on resizing windows before and after showing the version browser (also disabled by NSWindowResizeTime -float 0.001)

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false

Disable rubberband scrolling (doesn't affect web views)

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSScrollViewRubberbanding -bool false

Disable Dock show/hide animations

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock autohide-time-modifier -float 0

Reduce Dock show/hide delay

macOS 10.12+

#!/usr/bin/env bash
defaults write com.apple.dock autohide-delay -float 0.1

Disable animation on column views

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0.001

Disable menubar show animation during fullscreen mode

macOS 10.12+

#!/usr/bin/env bash
defaults write -g NSToolbarFullScreenAnimationDuration -float 0.001

Compatibility Tweaks

Disable Non-Retina Font Smoothing

Fixes an issue with some applications that have poor smoothing in Mojave when not running on Retina monitors.

macOS 10.14

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO