whatisgithub

What is sleepbar?

ddasy/sleepbar — explained in plain English

Analysis updated 2026-06-24

20SwiftAudience · generalComplexity · 1/5LicenseSetup · easy

In one sentence

A tiny macOS menu bar app that adds a one-off countdown timer to sleep, lock, or turn off your screen, without permanently changing any system setting.

Mindmap

mindmap
  root((SleepBar))
    What it does
      Countdown timers
      Screen sleep control
      Timed Lock mode
    Timer actions
      Lock screen
      Turn off display
      Full sleep
    Install options
      curl one-liner
      Build from source
      Disk image
    Languages
      English Chinese
      Spanish Arabic
      Japanese German
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Set a 30-minute timer so your Mac screen turns off after a download completes, without changing any system energy settings permanently

USE CASE 2

Enable Timed Lock mode in a shared office so your Mac automatically locks when you walk away for more than 5 minutes, for a set number of hours

USE CASE 3

Keep your screen awake during a presentation with one click, then let normal sleep behavior resume automatically when done

USE CASE 4

Install SleepBar from source with a single curl command and start using it from the menu bar immediately

What is it built with?

SwiftmacOS

How does it compare?

ddasy/sleepbardai-ski/lyrahreinssondev/anypip
Stars201921
LanguageSwiftSwiftSwift
Setup difficultyeasymoderateeasy
Complexity1/52/51/5
Audiencegeneralgeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires macOS 14 or later, the pre-built disk image is unsigned so macOS shows a security warning on first launch.

Use freely for any purpose, including commercial, as long as you keep the copyright notice.

So what is it?

SleepBar is a small macOS menu bar app that adds a countdown timer for turning off your screen or locking your Mac. The problem it solves is that macOS has a single fixed delay for when the screen turns off, and changing it requires opening System Settings each time. SleepBar puts a clickable icon in your menu bar so you can set a one-off timer of 5, 10, 15, or 30 minutes, one hour, or any custom duration, without changing any system setting permanently. When the countdown ends, you choose what happens: lock the screen only, lock and turn off the display to save power, or put the Mac to sleep entirely. You can also trigger any of those actions immediately with a single click, or flip it to "Never" to keep the screen awake indefinitely for presentations, long downloads, or running scripts. There is also a separate mode called Timed Lock that works differently. Instead of a one-shot countdown, you give it two numbers: how many minutes of no input triggers a lock, and how long the whole thing runs before it stops watching. During that window, the Mac locks itself whenever you walk away for the idle period you chose, then re-arms after you return and unlock. This is useful in shared spaces where you want automatic locking for a couple of hours without permanently changing your system lock settings. The app is built in Swift and described as extremely lightweight, using about zero percent CPU when idle. It wraps macOS command-line tools that are already on your system rather than installing background services or modifying energy settings. All changes are temporary and revert when the timer ends. Installation options include a one-line curl command that compiles and installs the app for you, a manual build from source, or a pre-built disk image from the Releases page. The app is available in English, Chinese, Spanish, Arabic, Portuguese, Japanese, and German. It runs on macOS 14 and later and is released under the MIT license.

Copy-paste prompts

Prompt 1
I want my Mac to lock and turn off the display exactly 20 minutes from now. How do I set a custom timer in SleepBar from the menu bar?
Prompt 2
Explain how to use SleepBar's Timed Lock mode: I want my Mac to lock after 3 minutes of no input, for the next 2 hours, then stop watching automatically.
Prompt 3
How do I install SleepBar using the curl one-liner, and what does the script actually do to my system?

Frequently asked questions

What is sleepbar?

A tiny macOS menu bar app that adds a one-off countdown timer to sleep, lock, or turn off your screen, without permanently changing any system setting.

What language is sleepbar written in?

Mainly Swift. The stack also includes Swift, macOS.

What license does sleepbar use?

Use freely for any purpose, including commercial, as long as you keep the copyright notice.

How hard is sleepbar to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is sleepbar for?

Mainly general.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.