mac os general - TeamFlowerPower/kb GitHub Wiki

Mac OS

General

Terminal

Fix error: can't be opened because Apple cannot check it for malicious software.

xattr -d com.apple.quarantine /Applications/<appName>.app

Stop Mac from stopping me opening files

# Check status with
sudo spctl --status

sudo spctl --master-disable

# Check status with
sudo spctl --status

Stop creating DS_STORE files

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

-> Reboot afterwards

Stop waking during the night

  • Dominant Wake Triggers:
    • ATC2.USBWakeup / USB2_wake: USB-C charging controller polling/activity (common on M-series when plugged in; often due to charger/cable).
    • NUB.SPMI0.SW3.IRQ / rtc/Maintenance: Real-time clock firing for scheduled background tasks (e.g., Calendar refresh, Spotlight, analytics).
  • Scheduled Events (from pmset -g sched):
    • com.apple.alarm.user-invisible-com.apple.calaccessd.travelEngine.periodicRefreshTimer -> Calendar background travel data refresh.
    • com.apple.alarm.user-invisible-com.apple.acmd.alarm -> Apple Content Management Daemon timer (likely updates/analytics).

Check events:

pmset -g sched
  1. Check in Battery Settings
    • "Wake for network access" disabled
  2. Cancel Scheduled Wakes: sudo pmset schedule cancelall
    • Verify: pmset -g sched (should be empty)
  3. Lock AutoWake Plist (prevents re-addition): sudo chflags schg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
    • How to revert if needed: sudo chflags noschg /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
  4. Optional: Reduce Daemon Triggers:
    • Turn off Calendar/iCloud sync if unused
    • Disable "Share Mac Analytics" in Privacy settings
  5. Test: Sleep Mac, check logs: pmset -g log | grep -i "wake" | tail -50
    • Check for absence of RTC/maintenance or USB wakes

Always show hidden files in Finder

defaults write com.apple.finder AppleShowAllFiles TRUE

Repeat key while holding it down

defaults write -g ApplePressAndHoldEnabled -bool false

-> A bit counter-intuitive but false = repeat while holding down

Modify banner display time

defaults write com.apple.notificationcenterui bannerTime 2               # Time in seconds

Windows/ISO keyboard

If you want to have the same keys assigned as for the Mac keyboard go to System Settings -> Keyboard -> Keyboard Shortcuts... -> On the left side select Modifier Keys -> In Select keyboard select the right keyboard (e.g. USB keybaord) and assign: Option key to Command and Command key to Option.

Apps move to different screens after reconnecting displays

If you reconnect your displays and applications are not in were they supposed to be but switched to another display. Move the devault display bar in arrange displays so that they fit again (somehow for me it worked best to circle it).

https://superuser.com/a/1220526/591879

Enbale terminal auto-complete

Add these lines to ~/.inputrc:

set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete

Python

To enable run:

# bash
python -m pip completion --bash >> ~/.zprofile
# zsh
python -m pip completion --zsh >> ~/.zprofile

Usually ~/.zprofile is empty.

⚠️ **GitHub.com Fallback** ⚠️