Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sleep Calculator

An iOS Lock Screen widget that shows ideal wake-up times based on 90-minute sleep cycles.

ideal wake time = now + 15 min (time to fall asleep) + N × 90 min

for N = 4, 5, 6 cycles — 6h, 7.5h, and 9h of sleep.

Glance at your Lock Screen, see when to wake up if you fell asleep right now — no app to open.

Widget styles

Pick any (or all) from the widget gallery on the Lock Screen:

  • Ring (.accessoryCircular) — the primary 7.5h wake time as a capacity-style ring.
  • Inline (.accessoryInline) — a single-line fallback with the same primary time.
  • Rectangular (.accessoryRectangular) — all three wake times (6h / 7.5h / 9h) side by side.

Time format (12h/24h) and language (English/Spanish, currently) follow your device's system settings automatically.

Who this is for

This isn't on the App Store — the only way to get it onto a phone is to build it from this source code. That means you need a Mac and a little comfort with Xcode. It's free (no Apple Developer Program purchase needed), but it's a "developer-ish" install, not a tap-to-download one.

What you need

  • A Mac with Xcode 15+ installed (free, from the Mac App Store)
  • An iPhone running iOS 16 or later, connected to the Mac by cable
  • A free Apple ID signed into Xcode (Xcode → Settings → Accounts) — you don't need a paid Developer account for this

Install steps

  1. Download the code: on this GitHub page, click Code → Download ZIP and unzip it (or git clone if you have git).
  2. Open the project: double-click SleepCalculator.xcodeproj. Xcode opens.
  3. Point it at your own account: in Xcode's left sidebar, click the top blue project icon → for each of the two targets listed (SleepCalculator and SleepCalculatorWidgetExtension) → tab Signing & Capabilities → under Team, pick your own Apple ID from the dropdown (not the one already selected — that belongs to someone else's account and won't work for you).
    • If Xcode shows a red error about the bundle identifier already being in use, change the text field just above Team (it starts with ProdCaro.) to start with something unique to you instead, for both targets.
  4. Plug in your iPhone, unlock it, and tap Trust if it asks about this computer.
  5. At the top of the Xcode window, click the device dropdown (it may say "Any iOS Device" or show a simulator name) and select your iPhone from the list.
  6. Press the ▶ Run button (or ⌘R). Xcode installs the app on your phone.
    • If your phone shows an "Untrusted Developer" alert, or Xcode asks you to enable Developer Mode: on the iPhone go to Settings → Privacy & Security → Developer Mode, turn it on, let it restart, then run again.
  7. Add the widget: on the iPhone, long-press an empty part of the Lock Screen → Customize → tap a widget slot → search "Sleep Calculator" → choose the ring, rectangle, or inline style.

That's it — the app itself doesn't need to be opened again after this; the widget keeps working on its own.

Troubleshooting

  • "Communication with Apple failed: your team has no devices registered" — this can happen the first time you connect a new phone. Unlock the phone, make sure it's trusted, and try Run again; Xcode usually registers it automatically on the second attempt.
  • Widget doesn't show up in the gallery — make sure you ran the SleepCalculator app scheme (not the widget extension scheme) at least once, and that the build finished without errors.

License

MIT — see LICENSE.

About

Lock Screen widget that shows ideal wake-up times based on 90-minute sleep cycles. Build from source, no App Store.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages