惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
G
Google Developers Blog
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG

Show HN

The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code. GitHub - tamerh/enju: Coordinating Humans, AI Agents, and Compute as Peers on a Shared Workflow Graph
GitHub - Kuberwastaken/caffeineOSS: ☕ Caffeinate your Mac...
kuberwastake · 2026-06-25 · via Show HN

CaffeineOSS — caffeinate your mac

platform language deps license kexts

A tiny menu-bar app that stops your Mac from falling asleep. One click. Filled cup = awake. ☕


The story (or: why this exists at all)

I wanted the classic coffee-cup-in-the-menu-bar thing. Easy, right? Except my work laptop's MDM had other plans:

  1. Tried KeepingYouAwake → blocked.
  2. Tried the classic Caffeine app → blocked.
  3. Tried dropping a LaunchAgent → turns out the MDM had made ~/Library/LaunchAgents root-owned. Blocked.

At that point it was personal. Downloaded apps get a quarantine flag and have to clear notarization + an endpoint-management allowlist — but a binary you compile locally has no quarantine flag and isn't a pre-built app the MDM recognizes. So I got bored, opened a .swift file, and wrote my own in ~120 lines.

CaffeineOSS wasn't a real project. It's not on Homebrew, it wasn't on GitHub, the name didn't exist. I just built it because I was bored and the corporate firewall made me angry. Now it's here. ☕


What it actually does

Under the hood it's the same trick Apple's own /usr/bin/caffeinate uses — a single public IOKit call:

IOPMAssertionCreateWithName(
    kIOPMAssertionTypePreventUserIdleDisplaySleep as CFString,
    IOPMAssertionLevel(kIOPMAssertionLevelOn),
    "CaffeineOSS keeping the Mac awake" as CFString,
    &assertionID
)

That's it. It asks the OS power manager to prevent user-idle display/system sleep while active, and releases the assertion when you toggle off. No kernel extensions, no private APIs, no special entitlements, no daemons phoning home.

  • 🟤 Outline cup = sleep allowed (normal)
  • Filled cup = staying awake
  • Timed modes — awake for 30 min / 1 h / 2 h / 5 h, then auto-off
  • 🪶 Featherweight — one Swift file, zero dependencies, no Dock icon (menu-bar only)

Install (build it yourself — that's the whole point)

You need the Xcode Command Line Tools (xcode-select --install). Then:

git clone https://github.com/kuberwastaken/caffeineOSS.git
cd caffeineOSS
./build.sh
open CaffeineOSS.app

build.sh compiles main.swift, wraps it in a proper .app bundle, and ad-hoc signs it locally — so there's no quarantine flag for an MDM/Gatekeeper to choke on.

Tip

Because you compiled it yourself, there's no com.apple.quarantine attribute and nothing for notarization gates to reject. This is exactly why it runs where the prebuilt apps didn't.


Start at login (survives reboots)

The clean way is a LaunchAgent — but if your MDM has locked down ~/Library/LaunchAgents (mine had), use the per-user Login Items list instead, which doesn't need that directory:

osascript -e 'tell application "System Events" to make login item at end with properties {path:"'$PWD'/CaffeineOSS.app", hidden:true, name:"CaffeineOSS"}'

Verify it took:

osascript -e 'tell application "System Events" to get name of every login item'

You can also do this by hand in System Settings → General → Login Items → +.


Uninstall

# stop it
osascript -e 'quit app "CaffeineOSS"'
# remove from login items
osascript -e 'tell application "System Events" to delete login item "CaffeineOSS"'
# delete the build
rm -rf CaffeineOSS.app

No-install fallback

If even a locally-built app gets blocked, macOS ships the original. Zero install, zero app:

caffeinate -d        # keep display awake until Ctrl-C
caffeinate -t 3600   # awake for 1 hour
caffeinate make      # awake until `make` finishes

CaffeineOSS is really just a friendly coffee cup glued on top of that idea.


Project layout

caffeineOSS/
├── main.swift        # the entire app (~120 lines)
├── build.sh          # compile → .app bundle → ad-hoc sign
├── assets/
│   └── banner.svg    # the cup up top
└── README.md

License

MIT — see LICENSE. Do whatever you want with it. ☕

Built because I was bored and the corporate firewall made me angry.