Keep your Mac awake
magpie only answers while its Mac is on, awake and logged in, with Messages running. These settings keep it that way, so a text at 3 AM still gets an answer and the Mac comes back by itself after a power cut. They’re for the Mac that runs magpie, which should be a Mac of its own, like a Mac mini.
Stop it sleeping
Open System Settings and click Energy in the sidebar (you may need to scroll down). Then:
- Turn on Prevent automatic sleeping when the display is off.
- Turn on Wake for network access.
- Turn on Start up automatically after a power failure. Some Macs have Start up when power is connected instead: set it to After power failure.
These are the Energy settings on desktop Macs, and Apple notes that some may not be available, depending on your Mac.
The display can still turn off: its timer is in System Settings under Lock Screen. With automatic sleeping prevented, the Mac stays awake when the display goes dark. A locked screen is fine too. Logging out isn’t, because that quits Messages and magpie.
Or set it in Terminal
pmset changes the same power settings. It asks for an administrator password.
sudo pmset -a sleep 0
sudo pmset -a womp 1
sudo pmset -a autorestart 1 -
sleep 0turns off the timer that puts the Mac to sleep. -
womp 1is Wake for network access. -
autorestart 1starts the Mac again after it loses power.
The display has a timer of its own, in minutes. To let it turn off after 10 idle minutes:
sudo pmset -a displaysleep 10
To see the settings in use, run the command below and look for sleep 0, womp 1 and autorestart 1. Then check that System Settings shows the same under Energy.
pmset -g Log in by itself
magpie and Messages run in your logged-in session. After a restart the Mac waits at the login window, where neither of them runs, unless it logs in by itself.
- Open System Settings and click Users & Groups.
- Choose your account from the Automatically log in as menu.
- Enter the account’s password.
magpie starts whenever you log in, since its setup ran magpie service install, so it’s back after every
restart.
If that menu is dimmed
Automatic login isn’t available while FileVault is on: Apple requires a manual login then. It isn’t available either when the account logs in with its Apple Account password, or when an organization manages the Mac with a profile that prohibits it.
To turn off FileVault, open System Settings, click Privacy & Security, then FileVault. Turn off FileVault, then click Turn Off Encryption.
With FileVault off and automatic login on, anyone who can switch the Mac on gets in. Keep it somewhere you trust.
macOS updates
Installing a macOS update restarts the Mac, and it might restart several times along the way. With the settings above, it logs back in afterwards and magpie starts again.
magpie sends through imbridge, which relies on private parts of Messages that an update can change. After each update, run imbridge’s check before trusting it again:
imbridge doctor To choose when updates happen, open System Settings, click General, then Software Update. Click the info button next to Automatic Updates, and turn off Install macOS updates.
Try it
Restart the Mac and leave it alone. It should come back to your desktop by itself, and magpie should answer a text.