defaults
usage
commands
read
prints the user’s settings to standard output
read-type
prints the plist type for a given key
write
write a value for the given key
rename
rename a key
import
import a plist to a given domain
export
export a domain and all the keys as a plist
delete
delete a given key or a domain / all keys for a given domain
domains
prints the name of all domains
find
search all domains, keys, and values for a given word
usage
basic usage
# gets all
$ defaults read DOMAIN
# gets
$ defaults read DOMAIN PROPERTY_NAME
# find
$ defaults find <KEYWORD>
# get type
$ defaults read-type <DOMAIN> <KEY>
# rename
$ defaults rename <DOMAIN> <OLD_KEY> <NEW_KEY>
# sets
$ defaults write DOMAIN PROPERTY_NAME VALUE
# resets a property
$ defaults delete DOMAIN PROPERTY_NAME
# resets preferences
$ defaults delete DOMAINlist all domains
$ defaults domainsi.e.
$ defaults domains | tr ',' '\n' | head ContextStoreAgent MobileMeAccounts com.100hps.captin com.ScooterSoftware.BeyondCompare com.app77.pwsafemac com.apple.AMPLibraryAgent com.apple.ATS com.apple.Accessibility com.apple.AdLib com.apple.AddressBook
defaults
programming
xCode
add additional Counterpart Suffixes
# `"ViewModel" "View"`
$ defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View" && killall Xcode
# `"Router" "Interactor" "Builder"`
$ defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "Router" "Interactor" "Builder" && killall Xcodeshow build durations
$ defaults write com.apple.dt.Xcode ShowBuildOperationDuration -bool true && killall Xcodeadd additional counterpart suffixes
# add "ViewModel" and "View"
$ defaults write com.apple.dt.Xcode "IDEAdditionalCounterpartSuffixes" -array-add "ViewModel" "View" && killall Xcode
# add "Router", "Interactor" and "Builder"
$ defaults write com.apple.dt.Xcode "IDEAdditionalCounterpartSuffixes" -array-add "Router" "Interactor" "Builder" && killall Xcode$ defaults write com.apple.dt.Xcode "ShowBuildOperationDuration" -bool "true" && killall XcodeiTerm2
profile
# reset
$ cd ~/Library/Preferences/com.googlecode.iterm2.plist
$ defaults delete com.googlecode.iterm2prompt when quitting
# disable
$ defaults write com.googlecode.iterm2 PromptOnQuit -bool falseterminal
# UTF-8 encoding
$ defaults write com.apple.terminal StringEncodings -array 4
# theme
$ defaults write com.apple.terminal "Default Window Settings" -string "gruvbox-dark"
$ defaults write com.apple.terminal "Startup Window Settings" -string "gruvbox-dark"
# more
$ defaults read com.apple.terminalenable security keyboard
[!NOTE|label:references:]
$ defaults write com.apple.terminal SecureKeyboardEntry -bool trueline marks
# disable
$ defaults write com.apple.terminal ShowLineMarks -int 0$ osascript <<EOD
tell application "Terminal"
local allOpenedWindows
local initialOpenedWindows
local windowID
set themeName to "Solarized Dark xterm-256color"
(* Store the IDs of all the open terminal windows. *)
set initialOpenedWindows to id of every window
(* Open the custom theme so that it gets added to the list
of available terminal themes (note: this will open two
additional terminal windows). *)
do shell script "open '$HOME/init/" & themeName & ".terminal'"
(* Wait a little bit to ensure that the custom theme is added. *)
delay 1
(* Set the custom theme as the default terminal theme. *)
set default settings to settings set themeName
(* Get the IDs of all the currently opened terminal windows. *)
set allOpenedWindows to id of every window
repeat with windowID in allOpenedWindows
(* Close the additional windows that were opened in order
to add the custom theme to the list of terminal themes. *)
if initialOpenedWindows does not contain windowID then
close (every window whose id is windowID)
(* Change the theme for the initial opened terminal windows
to remove the need to close them in order for the custom
theme to be applied. *)
else
set current settings of tabs of (every window whose id is windowID) to settings set themeName
end if
end repeat
end tell
EODdeveloper mode
[!NOTE|label:references:]
$ sudo spctl developer-mode enable-terminal
Terminal added as a developer tool. Enable in the Privacy & Security Settings.
# or
$ sudo /usr/sbin/DevToolsSecurity --enable
utilities
# disable
$ sudo nvram StartupMute=%01
# or
$ sudo nvram SystemAudioVolume=" "
# enable
$ sudo nvram StartupMute=%00forbidden spell automatic correction
$ defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false
$ defaults write -g NSAutomaticDashSubstitutionEnabled -bool false
$ defaults write -g NSAutomaticSpellingCorrectionEnabled -bool falsedisable notification centers
$ launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && killall NotificationCenterare you sure you want to open this application?
# old version
$ sudo spctl --master-disable
# new version
$ sudo spctl --global-disable
Globally disabling the assessment system needs to be confirmed in System Settings
# disable quarantine
$ defaults write com.apple.LaunchServices LSQuarantine -bool false
$ /usr/bin/xattr -c /path/to/app
# or
$ /usr/bin/xattr -d com.apple.quarantine /path/to/app

screenshot
suppress "Allow For One Month"
[!NOTE|label:references:]
# check info
$ defaults read ~/Library/Group\ Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist
{
"/Applications/Bob.app/Contents/MacOS/Bob" = "2024-09-19 22:33:43 +0000";
"/Applications/GIF Brewery 3.app/Contents/MacOS/GIF Brewery 3" = "2024-09-21 10:34:48 +0000";
"/Applications/Snipaste.app/Contents/MacOS/Snipaste" = "2024-10-22 07:04:02 +0000";
"/Applications/zoom.us.app/Contents/MacOS/zoom.us" = "2024-10-15 06:12:23 +0000";
}
# update one
$ defaults write ~/Library/Group\ Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist \
"/Applications/Snipaste.app/Contents/MacOS/Snipaste" \
-date "3024-01-01 00:00:00 +0000"
# update all
$ defaults read ~/Library/Group\ Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist |
sed -nr 's|^\s*"([^"]+)".*$|\1|p' |
while read -r _name; do
defaults write ~/Library/Group\ Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist \
"${_name}" -date "3024-01-01 00:00:00 +0000" ;
done
# verify
$ defaults read ~/Library/Group\ Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist
{
"/Applications/Bob.app/Contents/MacOS/Bob" = "3024-01-01 00:00:00 +0000";
"/Applications/GIF Brewery 3.app/Contents/MacOS/GIF Brewery 3" = "3024-01-01 00:00:00 +0000";
"/Applications/Snipaste.app/Contents/MacOS/Snipaste" = "3024-01-01 00:00:00 +0000";
"/Applications/zoom.us.app/Contents/MacOS/zoom.us" = "3024-01-01 00:00:00 +0000";
}set screenshot location
# `~/Picture/Screenshots`
$ defaults write com.apple.iphonesimulator ScreenShotSaveLocation -string ~/Pictures/Screenshots
# `~/Picture/Simulator Screenshots`
$ defaults write com.apple.iphonesimulator ScreenShotSaveLocation -string ~/Pictures/Simulator Screenshotsshadow
# show
$ defaults write com.apple.screencapture disable-shadow -bool false && killall SystemUIServer
# disable
$ defaults write com.apple.screencapture disable-shadow -bool true && killall SystemUIServerinclude date
# include
$ defaults write com.apple.screencapture include-date -bool true && killall SystemUIServer
# disable
$ defaults write com.apple.screencapture include-date -bool false && killall SystemUIServersave location
# `~/Desktop`
$ defaults write com.apple.screencapture location -string ~/Desktop && killall SystemUIServer
# `~/Pictures`
$ defaults write com.apple.screencapture location -string ~/Pictures && killall SystemUIServerthumbnail
# display
$ defaults write com.apple.screencapture show-thumbnail -bool true
# disable thumbnail
$ defaults write com.apple.screencapture show-thumbnail -bool falsescreenshot format
# `png`
$ defaults write com.apple.screencapture type -string png
# `jpg`
$ defaults write com.apple.screencapture type -string jpgfinder
hidden file
show hidden files
[!TIP|label:shortcuts:]
⇧ + ⌘ + . ( shift + command + . )
# show
$ defaults write com.apple.Finder AppleShowAllFiles -bool true && killall Finder
# or
$ defaults write com.apple.finder AppleShowAllFiles YES
# -- global mode --
$ defaults write -g AppleShowAllFiles -bool true
# disable
$ defaults write com.apple.Finder AppleShowAllFiles -bool false && killall Finder
# or
$ defaults write com.apple.Finder AppleShowAllFiles NOdisable the .DS_Store and ._*
[!NOTE|label:references:]
Junk files created by macOS (or Finder)...
You can disable MDS on a specific volume, but you need to create a hidden file to do it
$ sudo touch /Volumes/{drive name}/.metadata_never_index
.DS_Store– The name of a file in the Apple OS X operating system for storing custom attributes of a folder such as the position of icons or the choice of a background image (Read more)
.Spotlight-V100– This file holds information to speed up the 'Spotlight Search' feature. Deleting would simply force this information to be re-indexed if you performed another Spotlight Search for an item in this folder.
.apDisk– This file holds information about shared folders and can be safely removed as it will be automatically re-created if Apple needs it.
.VolumeIcon.icns– This file is used to store the icon of the volume (USB device) if the volume uses a custom icon and not the default icon. If you want the device to continue using this default icon, or if the folder/device you want to clean contains an application, you might want to keep this file in your system. As a side note, if you wanted to create a custom icon for your device you could create/download an .icns file and rename it .VolumeIcon.icns and place in your folder/device.
.fseventsd– This file is used as a buffer for the File System Events daemon. If you are using a program that is monitoring this folder/device, this file might be used to store temporary data.
.Trash&.Trashes– These folders are used to hold deleted items the same way that the 'Trash' icon from the dock works. If you don't need this feature on your folder/device, you can clean this folder to save space.
.TemporaryItems– This file is used by the OS to hold temporary data when files are being copied/moved/appended. If you are running any programs that are accessing the folder/device you want to clean, and you aren't copying or moving any files, then this file can simply hold old data for caching.
# network drives
$ defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# usb drives
$ defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# enable
$ defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool false
$ defaults write com.apple.desktopservices DSDontWriteUSBStores -bool falseresult
$ defaults read com.apple.desktopservices { DSDontWriteNetworkStores = 1; DSDontWriteUSBStores = 1; }
# hidden quite
$ defaults write com.apple.finder QuitMenuItem -bool false && killall Finder
# enable quite
$ defaults write com.apple.finder QuitMenuItem -bool true && killall Finderdefault location
$ defaults write com.apple.finder NewWindowTarget -string "PfDe"
$ defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"timestamp on zip filenames
# enable
$ defaults write com.apple.Finder ArchiveTimestamp -bool true
# disable
$ defaults delete com.apple.Finder ArchiveTimestamp$ defaults write com.apple.finder "FXRemoveOldTrashItems" -bool "true" && killall Finderfinder sound
# turn on
$ defaults write com.apple.Finder FinderSounds -bool false
# turn off
$ defaults delete com.apple.Finder FinderSoundstrash sounds
# disable
$ defaults write com.apple.Finder WarnOnEmptyTrash -bool falseextension
# show
$ defaults write NSGlobalDomain AppleShowAllExtensions -bool true && killall Finder
# disable
$ defaults write NSGlobalDomain AppleShowAllExtensions -bool false && killall Finder
# show warning when change file extension warning
$ defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true && killall Finder
# silent when change file extension warning
$ defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false && killall Finderview
full POSIX path in toolbar title
$ defaults write com.apple.finder _FXShowPosixPathInTitle -bool truecolumn view
[!TIP]
icnv: Icon View
clmv: Column View
Flwv: Cover Flow View
Nlsv: List View
$ defaults write com.apple.finder FXPreferredViewStyle clmv && killall Finder$ defaults write com.apple.finder "_FXSortFoldersFirst" -bool "true" && killall Finder
# for desktop
$ defaults write com.apple.finder "_FXSortFoldersFirstOnDesktop" -bool "true" && killall Finderanimation when opening the Info window in Finder
# disable
$ defaults write com.apple.Finder DisableAllAnimations -bool trueicon
# small: 1
$ defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1 && killall Finder
# medium: 2
$ defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2 && killall Finder
# large: 3
$ defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 3 && killall Findershow item info near icons
$ /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plistshow item info to right of icons
$ /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plistsnap-to-grid for icons
$ /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plistincrease grid spacing for icons
$ /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plistincrease the size of icons
$ /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
$ /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plistbars
show path bar
$ defaults write com.apple.finder ShowPathbar -bool trueshow status bar
$ defaults write com.apple.finder ShowStatusBar -bool trueshow icon in the title bar
$ defaults write com.apple.universalaccess "showWindowTitlebarIcons" -bool "true" && killall Finderadjust toolbar title rollover delay
# `0.5`
$ defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0.5 && killall Finder
# `0`
$ defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0 && killall Finder
# `1`
$ defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 1 && killall Finderpanel
# expand save panel by default
$ defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
$ defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# expand print panel by default
$ defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
$ defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool trueothers
search scope
[!TIP]
SCcf: Search the current folder
SCsp: Use the previous search scope
SCev: Search this Mac
# use current directory as default search scope
$ defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"disk image verification
# disable
$ defaults write com.apple.frameworks.diskimages skip-verify -bool true
$ defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
$ defaults write com.apple.frameworks.diskimages skip-verify-remote -bool truesilent quiet
# quit printer app once the print jobs complete
$ defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool truesave to disk or iCloud
# yes: save to iCloud
$ defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool true
# no: save to disk by default
$ defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool falseselect && copy from quicklook
$ defaults write com.apple.finder QLEnableTextSelection -bool true ; killall Finderspring loading
# enable spring loading
$ defaults write NSGlobalDomain com.apple.springing.enabled -bool true
# disable spring loading delay
defaults write NSGlobalDomain com.apple.springing.delay -float 0volume mounted
# open finder automatically
$ defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
$ defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
$ defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool truedesktop
show wallpaper location
# show
$ defaults write com.apple.dock desktop-picture-show-debug-text -bool true
# not show
$ defaults delete com.apple.dock desktop-picture-show-debug-text$ defaults write com.apple.finder "_FXSortFoldersFirstOnDesktop" -bool "true" && killall Finder$ defaults write com.apple.finder CreateDesktop -bool false && killall Finder
# revert back
$ defaults write com.apple.finder CreateDesktop true && killall Findericons
show external disk
$ defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool trueshow hard drive
$ defaults write com.apple.finder ShowHardDrivesOnDesktop -bool falseshow connected servers
$ defaults write com.apple.finder ShowMountedServersOnDesktop -bool trueshow removeable media ( CDs, DVDs and iPods )
$ defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
menu bar
transparency
# disable transparency
$ defaults write com.apple.universalaccess reduceTransparency -bool truehighlight color
# green
$ defaults write NSGlobalDomain AppleHighlightColor -string "0.764700 0.976500 0.568600"
# black
$ defaults write NSGlobalDomain AppleHighlightColor -string "0.500000 0.500000 0.500000"flash clock time separators
# stay solid
$ defaults write com.apple.menuextra.clock FlashDateSeparators -bool false && killall SystemUIServer
# separator flashes
$ defaults write com.apple.menuextra.clock FlashDateSeparators -bool true && killall SystemUIServerset menu bar digital clock format
[!NOTE|label:region settings:]
ssfor seconds.
HHfor 24-hour clock.
EEEfor 3-letter day of the week.
d MMMfor day of the month and 3-letter month.
# `EEE d MMM HH:mm:ss`
$ defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM HH:mm:ss"
# `EEE h:mm:ss`
$ defaults write com.apple.menuextra.clock DateFormat -string "EEE h:mm:ss"
# `EEE HH:mm:ss`
$ defaults write com.apple.menuextra.clock DateFormat -string "EEE HH:mm:ss"menu bar transparency
# disable transparency
$ defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool falsedock
[!NOTE|label:references:]
$ defaults delete com.apple.dock && killall Dock
show
add a blank space
$ defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' && killall Dockadd recent items folder
$ defaults write com.apple.dock persistent-others -array-add '{"tile-data" = {"list-type" = 1;}; "tile-type" = "recents-tile";}' && killall Dock
# current status
$ defaults read com.apple.Dock persistent-others
(
)$ defaults write com.apple.dock "expose-group-apps" -bool "true" && killall Dockposition
[!TIP]
# `left`
$ defaults write com.apple.dock orientation -string left && killall Dock
# `right`
$ defaults write com.apple.dock orientation -string right && killall Dock
# `bottom`
$ defaults write com.apple.dock orientation -string bottom && killall Dockdisable delay of dock displaying
$ defaults write com.apple.Dock autohide-delay -float 0 && killall Dockshow recently
# show
$ defaults write com.apple.dock show-recents -bool true && killall Dock
# disable show
$ defaults write com.apple.dock show-recents -bool false && killall Dockrecent use rearrange space
# disable
$ defaults write com.apple.dock mru-spaces -bool false && killall Dockicon
highlight icon
$ defaults write com.apple.dock mouse-over-hilite-stack -bool true && killall Dock
# revert
$ defaults delete com.apple.dock mouse-over-hilite-stack && killall Dockicon size
tilesize
# `48` $ defaults write com.apple.dock tilesize -int 48 && killall Dock # read current value $ defaults read com.apple.dock tilesize 46# 72 $ defaults write com.apple.dock largesize -float 72 && killall Dock
remove none-opened apps ( show only active Apps )
$ defaults write com.apple.dock static-only -boolean true && killall Dock
# revert
$ defaults delete com.apple.dock static-only && killall Dockwhether show hidden icon
# show semi-transparent icon in hide mode
$ defaults write com.apple.dock showhidden -bool true && killall Dock
# show no differences with non-hide
$ defaults delete com.apple.Dock showhidden && killall Dockanimation
opening applications animation
# enable
$ defaults write com.apple.dock launchanim -bool true
# disable
$ defaults write com.apple.dock launchanim -bool falseanimations when opening and closing windows
# disable
$ defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool falseanimations when opening a Quick Look window
# disable
$ defaults write -g QLPanelAnimationDuration -float 0animation of minimize windows
# * `suck`
$ defaults write com.apple.dock mineffect suck && killall Dock
# `genie`
$ defaults write com.apple.dock mineffect genie && killall Dock
# `scale`
$ defaults write com.apple.dock mineffect -string scale && killall Dockautohide
# auto hide
$ defaults write com.apple.dock autohide -bool true && killall Dock
# always show
$ defaults write com.apple.dock autohide -bool false && killall Dockautohide animation delay
[!NOTE|label:precondition]
setup autohide to true
# `0.5`
$ defaults write com.apple.dock autohide-time-modifier -float 0.5 && killall Dock
# `2`
$ defaults write com.apple.dock autohide-time-modifier -float 2 && killall Dock
# `0`
$ defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock
# read current value
$ defaults read com.apple.dock autohide-time-modifier
1autohide delay
[!NOTE|label:precondition]
setup autohide to true
# `0.5`
$ defaults write com.apple.dock autohide-delay -float 0.5 && killall Dock
# `0`
$ defaults write com.apple.dock autohide-delay -float 0 && killall Dock
# read current value
$ defaults read com.apple.dock autohide-delay
0others
2D Dock
$ defaults write com.apple.dock no-glass -bool trueenable iTunes track notifications in the dock
$ defaults write com.apple.dock itunes-notifications -bool truehighlight hover effect
# enable highlight
$ defaults write com.apple.dock mouse-over-hilte-stack -bool truespeeding up mission control animations
$ defaults write com.apple.dock expose-animation-duration -float 0.1
$ defaults write com.apple.dock "expose-group-by-app" -bool truespring loading for all Dock items
$ defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool trueindicator lights for open apps
# show indicators lights
$ defaults write com.apple.dock show-process-indicators -bool truemission control
rearrange automatically
# base on most of recent use
$ defaults write com.apple.dock mru-spaces -bool true && killall Dock
# keep space arrangement
$ defaults write com.apple.dock mru-spaces -bool false && killall Dockswitch to space with open windows
$ defaults write NSGlobalDomain "AppleSpacesSwitchOnActivate" -bool "true" && killall Dock$ defaults write com.apple.spaces "spans-displays" -bool "true" && killall SystemUIServerkeyboard
[!NOTE|label:references:]
$ defaults write NSGlobalDomain ApplePressAndHoldEnabled -boolean false
# or
$ defaults write -g ApplePressAndHoldEnabled -bool falserestore
$ defaults delete -g ApplePressAndHoldEnabledkey repeat for in specific apps
# chrome $ defaults delete -g ApplePressAndHoldEnabled $ defaults write "com.google.Chrome" ApplePressAndHoldEnabled 0 # vscode $ defaults delete com.microsoft.VSCode ApplePressAndHoldEnabled $ defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool falseread form NSGlobalDomain
$ defaults read NSGlobalDomain KeyRepeat 2
fast keyboard response
$ defaults write NSGlobalDomain KeyRepeat -int 0.02reduce key repeat delay
$ defaults write NSGlobalDomain InitialKeyRepeat -int 12enable full keyboard access
[!TIP] Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
$ defaults write NSGlobalDomain AppleKeyboardUIMode -int 3auto-correct
# disable
$ defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# enable
$ defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool trueauto-capitalization

# disable
$ defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
# enable
$ defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool truekeyboard illumination
# turn off keyboard illumination when computer is not used for 5 minutes
$ defaults write com.apple.BezelServices kDimTime -int 300increasing sound quality for bluetooth
$ defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40trackpad
[!TIP]
# light: 0
$ defaults write com.apple.AppleMultitouchTrackpad "FirstClickThreshold" -int "0"
# medium: 1
$ defaults write com.apple.AppleMultitouchTrackpad "FirstClickThreshold" -int "1"
# firm: 2
$ defaults write com.apple.AppleMultitouchTrackpad "FirstClickThreshold" -int "2"enable dragging with drag lock
$ defaults write com.apple.AppleMultitouchTrackpad "DragLock" -bool "true"Enable dragging without drag lock
$ defaults write com.apple.AppleMultitouchTrackpad "Dragging" -bool "true"enable dragging with three finger drag
$ defaults write com.apple.AppleMultitouchTrackpad "TrackpadThreeFingerDrag" -bool "true"enable tap to click
[!NOTE|label:references:]
$ defaults -currentHost read NSGlobalDomain | grep trackpad "com.apple.trackpad.enableSecondaryClick" = 1; "com.apple.trackpad.fiveFingerPinchSwipeGesture" = 2; "com.apple.trackpad.fourFingerHorizSwipeGesture" = 2; "com.apple.trackpad.fourFingerPinchSwipeGesture" = 2; "com.apple.trackpad.fourFingerVertSwipeGesture" = 2; "com.apple.trackpad.momentumScroll" = 1; "com.apple.trackpad.pinchGesture" = 1; "com.apple.trackpad.rotateGesture" = 1; "com.apple.trackpad.scrollBehavior" = 2; "com.apple.trackpad.threeFingerDragGesture" = 0; "com.apple.trackpad.threeFingerHorizSwipeGesture" = 2; "com.apple.trackpad.threeFingerTapGesture" = 2; "com.apple.trackpad.threeFingerVertSwipeGesture" = 2; "com.apple.trackpad.twoFingerDoubleTapGesture" = 1; "com.apple.trackpad.twoFingerFromRightEdgeSwipeGesture" = 3; "com.apple.trackpad.version" = 5;
$ defaults write com.apple.AppleMultitouchTrackpad Clicking -int 1
$ defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
$ defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1or
# read $ defaults read NSGlobalDomain com.apple.trackpad.forceClick 0 # set via: $ defaults write -g com.apple.trackpad.forceClick 0
enable three finger to drag
$ defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool true
$ defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -bool truetrackpad & mouse speed
$ defaults write -g com.apple.trackpad.scaling 2
$ defaults write -g com.apple.mouse.scaling 2.5
# read
$ defaults read NSGlobalDomain com.apple.trackpad.scaling
2
$ defaults read NSGlobalDomain com.apple.mouse.scaling
2.5battery percent
# show battery percent
$ defaults write com.apple.menuextra.battery ShowPercent -string "YES"remaining battery time
$ defaults write com.apple.menuextra.battery ShowTime -string "YES"browser
chrome
sensitive backswipe
# disable on trackpads
$ defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
$ defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
# disable on magic mouse
$ defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false
$ defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool falsesystem-native print preview
$ defaults write com.google.Chrome DisablePrintPreview -bool true
$ defaults write com.google.Chrome.canary DisablePrintPreview -bool trueexpand the print dialog
$ defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
$ defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool truesafari
$ defaults write com.apple.Safari "ShowFullURLInSmartSearchField" -bool "true" && killall Safaridns prefetching
# disable
$ defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
# enable
$ defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean truebookmarks
# hidden bookmark
$ defaults write com.apple.Safari ShowFavoritesBar -bool false
# removing useless icons from bookmark bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"sidebar
# hidden
$ defaults write com.apple.Safari ShowSidebarInTopSites -bool falsethumbnail cache
# disable
$ defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2debug mode
# enable debug menu
$ defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# or
$ defaults write com.apple.Safari IncludeInternalDebugMenu 1
standard deply
# disable
$ defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0.25
develop menu and the web inspector
# develop menu and the web inspector
$ defaults write com.apple.Safari IncludeDevelopMenu -bool true
$ defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
$ defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
# context menu for web inspector
$ defaults write NSGlobalDomain WebKitDeveloperExtras -bool truesearch banners
# search banners default to Contains instead of Starts With
$ defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool falsebackspace key to previous page
# disable
$ defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true$ defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2MinimumFontSize -int 14system
hot corners
[!TIP|label:references:]
Setting Mac hot corners in the terminal
0: No Option
2: Mission Control
3: Show application windows
4: Desktop
5: Start screen saver
6: Disable screen saver
7: Dashboard
10: Put display to sleep
11: Launchpad
12: Notification Center
13: Lock Screen
# bottom left - desktop
$ defaults write com.apple.dock wvous-bl-corner -int 4 && killall Dock
# bottom right - application windows
$ defaults write com.apple.dock wvous-br-corner -int 3 && killall Dock
# top right - mission control
$ defaults write com.apple.dock wvous-tr-corner -int 2 && killall Dock
# current settings
$ defaults read com.apple.dock | grep corner
"wvous-bl-corner" = 4;
"wvous-br-corner" = 3;
"wvous-tr-corner" = 2;
# or
$ defaults read com.apple.dock | grep corner | sed -n -E 's/ "(.+)" = (.+);/\1=\2/p'
wvous-bl-corner=4
wvous-br-corner=3
wvous-tr-corner=2
modifiers
[!TIP|label:references:]
Setting Mac hot corners in the terminal
0: No Modifier
131072: Shift Key
262144: Control Key
524288: Option Key
1048576: Command Key
# current settings
$ defaults read com.apple.dock | grep 'modifier'
"autohide-time-modifier" = "0.5";
"wvous-bl-modifier" = 0;
"wvous-br-modifier" = 0;
"wvous-tr-modifier" = 0
# or
$ defaults read com.apple.dock | grep modifier | sed -n -E 's/ "(.+)" = (.+);/\1=\2/p'
autohide-time-modifier="0.5"
wvous-bl-modifier=0
wvous-br-modifier=0
wvous-tr-modifier=0reduce the menu bar item spacing
[!TIP|label:see also]
# get current status
$ defaults -currentHost read -globalDomain NSStatusItemSpacing
$ defaults -currentHost read -globalDomain NSStatusItemSelectionPadding
# setup spacing
$ defaults -currentHost write -globalDomain NSStatusItemSpacing -int 12
$ defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 8
$ killall SystemUIServer
# revert
$ defaults -currentHost delete -globalDomain NSStatusItemSpacing
$ defaults -currentHost delete -globalDomain NSStatusItemSelectionPadding
$ killall SystemUIServerLaunchpad
enlarge icon
# enlarge
$ defaults write com.apple.Dock springboard-rows -int 4
$ defaults write com.apple.Dock springboard-columns -int 4
# shrink
$ defaults write com.apple.Dock springboard-rows -int 10
$ defaults write com.apple.Dock springboard-columns -int 10
# reset
$ defaults delete com.apple.Dock springboard-rows
$ defaults delete com.apple.Dock springboard-columns
$ defaults write com.apple.Dock ResetLaunchPad -bool truereset launchpad
$ defaults write com.apple.dock ResetLaunchPad -bool true && killall Dock
# or
$ [ -e ~/Library/Application\ Support/Dock/*.db ] && rm ~/Library/Application\ Support/Dock/*.db
# revert back
$ defaults delete com.apple.dock springboard-rows
$ defaults delete com.apple.dock springboard-columns
$ defaults write com.apple.dock ResetLaunchPad -bool true && killall Dockdashboard
disable dashboard
# disable
$ defaults write com.apple.dashboard mcx-disabled -boolean YES && killall Dock
# enable
$ defaults write com.apple.dashboard mcx-disabled -boolean NO && killall Dockkeyboard remapping
[!NOTE|label:references:]
ONLY for filco Minila
for filco minila air, enable dip switch 2, 5 and 6
2: change CapsLock and Esc
5: Mac-specific mode
6: power saving mode

keyboard
# read
$ defaults read NSGlobalDomain NSUserDictionaryReplacementItems
# quote option
$ defaults read NSGlobalDomain "KB_DoubleQuoteOption"
"abc"
$ defaults read NSGlobalDomain "KB_SingleQuoteOption"
'abc'
# repeatreset dns cache
[!NOTE|label:references:]
$ sudo dscacheutil -flushcache && sudo killall -HUP mDNSRespondermacOS 12 (Monterey)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 11 (Big Sur)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.15 (Catalina)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.14 (Mojave)
sudo killall -HUP mDNSResponder
macOS 10.13 (High Sierra)
sudo killall -HUP mDNSResponder
macOS 10.12 (Sierra)
sudo killall -HUP mDNSResponder
OS X 10.11 (El Capitan)
sudo killall -HUP mDNSResponder
OS X 10.10 (Yosemite)
sudo discoveryutil udnsflushcaches
OS X 10.9 (Mavericks)
sudo killall -HUP mDNSResponder
OS X 10.8 (Mountain Lion)
sudo killall -HUP mDNSResponder
Mac OS X 10.7 (Lion)
sudo killall -HUP mDNSResponder
Mac OS X 10.6 (Snow Leopard)
sudo dscacheutil -flushcache
Mac OS X 10.5 (Leopard)
sudo lookupd -flushcache
Mac OS X 10.4 (Tiger)
lookupd -flushcache
cursor
blink rate
# 1000 = 1 sec $ defaults write -g NSTextInsertionPointBlinkPeriodOn -float 200 $ defaults write -g NSTextInsertionPointBlinkPeriodOff -float 200 # revert $ defaults delete -g NSTextInsertionPointBlinkPeriodOn $ defaults delete -g NSTextInsertionPointBlinkPeriodOff
active dark mode
$ defaults write -g NSRequiresAquaSystemAppearance -bool true
# logout and login
# revert
$ defaults write -g NSRequiresAquaSystemAppearance -bool falseread from
NSGlobalDomain$ defaults read NSGlobalDomain AppleInterfaceStyle Dark
automatic terminate inactive apps
# disable
$ defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# enable
$ defaults write NSGlobalDomain NSDisableAutomaticTermination -bool falseviewer windows mode
# non-floating mode
$ defaults write com.apple.helpviewer DevMode -bool true
# floating mode
$ defaults write com.apple.helpviewer DevMode -bool falsetextEdit
# plain text mode
$ defaults write com.apple.TextEdit RichText -int 0
# revert
$ defaults delete com.apple.TextEdit RichText
# UTF-8 in TextEdit
$ defaults write com.apple.TextEdit PlainTextEncoding -int 4
$ defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4disk utility
# enable debug menu
$ defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
$ defaults write com.apple.DiskUtility advanced-image-options -bool trueQuickTime
[!NOTE|label:references:]
auto-play
# enable autostart movies
$ defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true
# disable autostart movies
$ defaults delete com.apple.QuickTimePlayerX MGPlayMovieOnOpenrounded corners
# diable rounded corners
$ defaults write com.apple.QuickTimePlayerX MGCinematicWindowDebugForceNoRoundedCorners -bool true
# enable rounded corners
$ defaults delete com.apple.QuickTimePlayerX MGCinematicWindowDebugForceNoRoundedCornerscontroller bar
# disable controller bar
$ defaults write com.apple.QuickTimePlayerX MGUIVisibilityNeverAutoshow -bool true
# enable controller bar
$ defaults delete com.apple.QuickTimePlayerX MGUIVisibilityNeverAutoshowauto show subtitles
# enable auto show subtitles
$ defaults write com.apple.QuickTimePlayerX MGEnableCCAndSubtitlesOnOpen -bool true
# disable auto show subtitles
$ defaults delete com.apple.QuickTimePlayerX MGEnableCCAndSubtitlesOnOpenApp Store
# enable the webkit developer tools
$ defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# enable debug menu
$ defaults write com.apple.appstore ShowDebugMenu -bool true
# enable the automatic update check
$ defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# check for software updates daily instead of weekly
$ defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# download newly available updates in background
$ defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
# install system data files & security updates
$ defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
# automatically download apps purchased on other macs
$ defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1
# turn on app auto-update
$ defaults write com.apple.commerce AutoUpdate -bool true
# allow the app store to reboot machine on macos updates
$ defaults write com.apple.commerce AutoUpdateRestartRequired -bool trueactivity monitor
# show main window
$ defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# visualize cpu usage
$ defaults write com.apple.ActivityMonitor IconType -int 5
# show all processes
$ defaults write com.apple.ActivityMonitor ShowCategory -int 0
# sort via cpu usage
$ defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
$ defaults write com.apple.ActivityMonitor SortDirection -int 0
# update frequency
$ defaults write com.apple.ActivityMonitor "UpdatePeriod" -int "1" && killall Activity\ Monitor
# dock icon type
## 1: regular icon
$ defaults write com.apple.ActivityMonitor "IconType" -int "0" && killall Activity\ Monitor
## 2: show network usage over time
$ defaults write com.apple.ActivityMonitor "IconType" -int "2" && killall Activity\ Monitor
## 3: show disk usage over time, as two mirrored line graphs
$ defaults write com.apple.ActivityMonitor "IconType" -int "3" && killall Activity\ Monitor
## 5: show the current cpu usages, as a verticle meter.
$ defaults write com.apple.ActivityMonitor "IconType" -int "5" && killall Activity\ Monitor
## 6: show cpu usage history, graphed over time
$ defaults write com.apple.ActivityMonitor "IconType" -int "6" && killall Activity\ Monitorover-the-top focus ring animation
# disable
$ defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool falsespotlight
# disable
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
# enable
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
# [not recommended] hide icon
$ sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
# stop indexing in a specific volume
$ sudo mdutil -i off "/Volumes/<name>"
# stop mdutil in a specific volume
$ sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes/<name>"change indexing order
defaults write com.apple.spotlight orderedItems -array \
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
'{"enabled" = 1;"name" = "PDF";}' \
'{"enabled" = 1;"name" = "FONTS";}' \
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
'{"enabled" = 0;"name" = "MESSAGES";}' \
'{"enabled" = 0;"name" = "CONTACT";}' \
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
'{"enabled" = 0;"name" = "IMAGES";}' \
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
'{"enabled" = 0;"name" = "MUSIC";}' \
'{"enabled" = 0;"name" = "MOVIES";}' \
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
'{"enabled" = 0;"name" = "SOURCE";}' \
'{"enabled" = 0;"name" = "MENU_DEFINITION";}' \
'{"enabled" = 0;"name" = "MENU_OTHER";}' \
'{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
'{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
'{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
'{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
# Load new settings before rebuilding the index
killall mds > /dev/null 2>&1
# make sure indexing is enabled for the main volume
sudo mdutil -i on / > /dev/null
# rebuild the index from scratch
sudo mdutil -E / > /dev/nullcrash reporter
# disable
$ defaults write com.apple.CrashReporter DialogType nonenotification center
# disable
$ launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && killall NotificationCenter
# enable
$ launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && killall NotificationCentertime machine
# disable dialog
$ defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# or disable local backup
$ hash tmutil &> /dev/null && sudo tmutil disablelocalscrollbars
# always show
$ defaults write NSGlobalDomain AppleShowScrollBars -string "Auto"rubber-band scrolling
# disable
$ defaults write -g NSScrollViewRubberbanding -int 0
# enable
$ defaults delete -g NSScrollViewRubberbandingairdrop
# enable airdrop from ethernet
$ defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool trueASCII control characters using caret notation in standard text views
[!NOTE|label:references:]
$ defaults write NSGlobalDomain NSTextShowsControlCharacters -bool truesystem-wide resume ( disable tab memory )
# disable
$ defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool falseloginwindow
# reveal ip address, hostname, os version, etc. when clicking the clock in the login window
$ sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# revert
$ sudo defaults delete /Library/Preferences/com.apple.loginwindow AdminHostInfosleep mode
[!TIP]
check current status
$ pmset -g # show detail $ pmset -g assertions # show log $ pmset -g log
$ pmset -g
System-wide power settings:
DestroyFVKeyOnStandby 0
Currently in use:
standby 1
Sleep On Power Button 1
hibernatefile /var/vm/sleepimage
powernap 1
networkoversleep 0
disksleep 180
sleep 0 (sleep prevented by bluetoothd, sharingd, powerd, useractivityd, runningboardd)
hibernatemode 3
ttyskeepawake 1
displaysleep 30
tcpkeepalive 1
lowpowermode 0
womp 1
# or
$ pmset -g
System-wide power settings:
DestroyFVKeyOnStandby 0
Currently in use:
standby 1
Sleep On Power Button 1
hibernatefile /var/vm/sleepimage
powernap 1
networkoversleep 0
disksleep 180
sleep 0 (sleep prevented by sharingd, powerd, bluetoothd)
hibernatemode 3
ttyskeepawake 1
displaysleep 0
tcpkeepalive 1
lowpowermode 0
womp 1$ pmset -g assertions | grep SystemSleep
PreventSystemSleep 0
PreventUserIdleSystemSleep 1
pid 1253(sharingd): [0x00005c8600019765] 00:01:29 PreventUserIdleSystemSleep named: "Handoff"
pid 322(powerd): [0x0000329f000191ea] 03:00:17 PreventUserIdleSystemSleep named: "Powerd - Prevent sleep while display is on"
pid 371(bluetoothd): [0x00005cdb0001977b] 00:00:04 PreventUserIdleSystemSleep named: "com.apple.BTStack"no idle
$ pmset noidlenever go to slepp mode
# default
$ sudo systemsetup -getcomputersleep
Computer Sleep: after 120 minutes
# never go to sleep mode
$ sudo systemsetup -setcomputersleep Off
2024-12-09 14:20:14.400 systemsetup[18647:239595] ### Error:-99 File:/AppleInternal/Library/BuildRoots/289ffcb4-455d-11ef-953d-e2437461156c/Library/Caches/com.apple.xbs/Sources/Admin/InternetServices.m Line:379
setcomputersleep: Never
# or
$ sudo systemsetup -setcomputersleep Off > /dev/null
# get
$ sudo systemsetup -getcomputersleep
Computer Sleep: Never
# disable computer sleep and stop the display from shutting off
$ sudo pmset -a sleep 0
$ sudo pmset -a displaysleep 0
# disable hibernatemode to speeds up entering sleep mode
$ sudo pmset -a hibernatemode 0# set display off timer
$ sudo pmset -a displaysleep 30
$ sudo pmset -a displaysleep 180
Warning: Idle sleep timings for "Battery Power" may not behave as expected.
- Display sleep should have a lower timeout than system sleep.
Warning: Idle sleep timings for "AC Power" may not behave as expected.
- Display sleep should have a lower timeout than system sleep.
# get display off timer
$ sudo pmset -g | grep displaysleep
displaysleep 180set standby
# to 24 hours
$ sudo pmset -a standbydelay 86400power button in stand-by mode
# disable
$ defaults write com.apple.loginwindow PowerButtonSleepsSystem -bool no
# revert to original
$ defaults write com.apple.loginwindow PowerButtonSleepsSystem -bool yesremove sleep image file
$ sudo rm /Private/var/vm/sleepimage
# creating a zero-byte file instead of
$ sudo touch /Private/var/vm/sleepimage
# make sure be rewritten
$ sudo chflags uchg /Private/var/vm/sleepimageun-useful sudden motion sensor for SSDs
# disable
$ sudo pmset -a sms 0smart quotes and smart dashes
# disable
$ defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
$ defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool falserequiring password immediately
[!NOTE|label:references:]
$ defaults write com.apple.screensaver askForPassword -int 1
$ defaults write com.apple.screensaver askForPasswordDelay -int 0subpixel font rendering
# enable subpixel font rendering on non-Apple LCDs
$ defaults write NSGlobalDomain AppleFontSmoothing -int 2HiDPI display modes
$ sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
$ sudo rebootprevent automatic sleep when display is off

screensaver
[!NOTE|label:references:]
$ defaults -currentHost read com.apple.screensaver
{
CleanExit = 1;
idleTime = 3600;
moduleDict = {
moduleName = Shell;
path = "/System/Library/ExtensionKit/Extensions/Shell.appex";
type = 0;
};
tokenRemovalAction = 0;
}
$ cd ~/Library/Application\ Support/com.apple.wallpaper/Store; \
plutil -extract "AllSpacesAndDisplays.Idle.Content.Choices.0.Configuration" raw Index.plist | base64 --decode > temp.plist; \
plutil -p temp.plist
{
"module" => {
"relative" => "file:///System/Library/ExtensionKit/Extensions/Shell.appex"
}
}others
feedback assistant
auto gather
# allow large $ defaults write com.apple.appleseed.FeedbackAssistant Autogather -bool true # not allow $ defaults write com.apple.appleseed.FeedbackAssistant Autogather -bool false
$ defaults write com.apple.sidecar.display AllowAllDevices -bool true;
$ defaults write com.apple.sidecar.display hasShownPref -bool true;
$ open /System/Library/PreferencePanes/Sidecar.prefPaneopen photos automatically
# disable
$ defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
# revert back
$ defaults -currentHost delete com.apple.ImageCapture disableHotPlugshow one application at a time
$ defaults write com.apple.dock single-app -bool true && killall Dock
# revert to orignial
$ defaults write com.apple.dock single-app -bool no && killall Dock# disable
$ defaults write /Library/Preferences/com.apple.security GKAutoRearm -bool false
# revert to original
$ defaults delete /Library/Preferences/com.apple.security GKAutoRearm
music song notifications
# show
$ defaults write com.apple.Music "userWantsPlaybackNotifications" -bool "false" && killall Music# disable
$ defaults write NSGlobalDomain "NSCloseAlwaysConfirmsChanges" -bool "true"# default
$ defaults write NSGlobalDomain com.apple.keyboard.fnState -bool false
# setup
$ defaults write NSGlobalDomain com.apple.keyboard.fnState -bool truedisable Recent Items
[!NOTE|label:references:]

backup & restore
backup
$ defaults export com.manytricks.Moom ~/Desktop/Moom.plistrestore
$ defaults import com.manytricks.Moom ~/Desktop/Moom.plist
vscode
backup
$ code --list-extensions >> vs_code_extensions_list.txtrestore
$ cat vs_code_extensions_list.txt | xargs -n 1 code --install-extension
$HOME/Library/Application Support/Code/User/settings.json
Last updated
Was this helpful?