Skip to content

nuqiewuoz/KeepAwake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

KeepAwake

A lightweight macOS menu bar app that prevents your display from sleeping.

Features

  • Menu bar icon toggle — click the eye icon to enable/disable
  • Uses IOPMAssertionCreateWithName to prevent idle display sleep
  • No Dock icon, lives entirely in the menu bar
  • Keyboard shortcuts: ⌘K to toggle, ⌘Q to quit

Requirements

  • macOS 14.0+
  • Xcode 15+

Build

Open KeepAwake.xcodeproj in Xcode and run, or:

xcodebuild -project KeepAwake.xcodeproj -scheme KeepAwake build

How It Works

PowerManager creates an IOKit power assertion of type kIOPMAssertionTypePreventUserIdleDisplaySleep to keep the display awake. The assertion is automatically released when disabled or when the app terminates.

Project Structure

KeepAwake/
├── KeepAwakeApp.swift   # App entry point, menu bar UI
├── PowerManager.swift   # IOKit power assertion management
├── Info.plist           # LSUIElement=true (hide Dock icon)
└── Assets.xcassets/     # App icons

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages