个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Free macOS menu bar app that keeps a MacBook running with the lid closed, no external display needed. Timer, battery stop and heat safety put sleep back on their own. macOS 14+, Apple silicon and Intel.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗A menu bar switch that keeps a Mac running with the lid closed. Turn it on for good, for a set time, or until the battery reaches a level you pick.
Paste this into Terminal:
curl -fsSL https://raw.githubusercontent.com/intuito-studio/nosleep/main/install.sh | bash
It downloads the latest release, puts NoSleep in Applications and opens it. Running it again reinstalls the latest version.
Needs macOS 14 or later, on Apple silicon or Intel.
Click the cat in the menu bar. It sleeps curled up when the Mac sleeps normally, and stares at a laptop, dark circles under its eyes, while the Mac is kept awake.
1:42.When a timer or the battery stop ends a session while the lid is shut, NoSleep puts the Mac to sleep straight away, so it isn't left running in a bag.
During a session, closing the lid turns the display off, mutes the audio and switches on Low Power Mode. Opening it unmutes and switches Low Power Mode back off. NoSleep only undoes what it did itself, so a mute or Low Power Mode you set yourself stays. The timer keeps running throughout. The built-in microphone is cut off in hardware while the lid is closed, so record with AirPods or an external mic.
On a MacBook with a lid angle sensor, the cat comes up from below the screen in Liquid Glass as the lid passes upright during a session, its paws over the bottom edge and its lit eyes following the pointer: a sign NoSleep is holding on. Fold the screen as the lid closes, in Settings, adds Mac Duo's fold: the desktop holds still while the lid turns around it, frosting and darkening from the top. The fold needs Screen Recording, asked for when you switch it on. Nothing shows with NoSleep off or with the lid open as usual.
NoSleep keeps the Mac awake; macOS keeps it connected. To fall back to your iPhone when the Wi-Fi drops, set System Settings → Wi-Fi → Ask to join hotspots to Automatic. The iPhone needs the same Apple Account.
Settings… in the panel lists what recent sessions did: when the lid closed and opened, what changed, and why a session ended.
NoSleep checks for a new release once a day. When there is one, a notification and the panel both offer Update: one click, and it restarts on the new version a few seconds later, still keeping the Mac awake if it was.
Quitting NoSleep switches sleep back on if NoSleep was the one holding it off.
Features 1 to 6 follow Insomnia (MIT), which got there first.
The fold, the hinge angle maths and the lid sensor reader are ported from Mac Duo by Nino Bouchedid (MIT; the notice is in THIRD-PARTY-NOTICES.md). The lid angle sensor's HID interface was first documented by Sam Henri Gold.
Most stay-awake apps hold a power assertion, which stops idle sleep but not lid
sleep. Only pmset disablesleep stops lid sleep, and only root may change it.
The first time you flip the switch, macOS asks for your admin password once.
NoSleep then installs this rule as /etc/sudoers.d/nosleep, after checking it
with visudo:
you ALL=(root) NOPASSWD: /usr/bin/pmset -a disablesleep 0, /usr/bin/pmset -a disablesleep 1, /usr/bin/pmset sleepnow, /usr/bin/pmset -a lowpowermode 0, /usr/bin/pmset -a lowpowermode 1
The rule allows exactly those five commands with exactly those arguments, and nothing else. Reading the current state needs no permission at all.
The terminal and the app use the same setting. If you run
sudo pmset -a disablesleep 1 (or a shell function that wraps it), the menu
bar shows it within two seconds. Once the rule is installed, those exact
commands stop asking for a password in the terminal too.
Quit NoSleep, then:
launchctl bootout gui/$(id -u)/dev.intuito.nosleep.backstop
rm ~/Library/LaunchAgents/dev.intuito.nosleep.backstop.plist
rm -rf /Applications/NoSleep.app
sudo rm /etc/sudoers.d/nosleep
defaults delete dev.intuito.nosleep
Needs Xcode (for actool, which compiles the icon), not just the Command Line Tools.
make run # debug build → .build/NoSleep.app → relaunch it
make test
make release # universal build → dist/NoSleep.dmg
To ship a version: bump VERSION, run make release, and follow the steps it
prints. You tag and push, then attach dist/NoSleep.dmg to a GitHub release.
Both the install line and the in-app updater download that file, so keep its
name.