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

推荐订阅源

Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
V
V2EX
博客园 - 叶小钗
雷峰网
雷峰网
小众软件
小众软件
量子位
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
Martin Fowler
Martin Fowler
G
Google Developers Blog
博客园_首页
博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - Kuberwastaken/caffeineOSS: ☕ Caffeinate your Mac...
kuberwastake · 2026-06-25 · via Hacker News: 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.