Skip to content

feat: add shortcuts actions, global shortcut, until time and cli - #6

Merged
duongdev merged 3 commits into
mainfrom
feat/0.2.0
Nov 14, 2026
Merged

duongdev merged 3 commits into
mainfrom
feat/0.2.0

Conversation

@duongdev

Copy link
Copy Markdown
Owner

Summary

Features for 0.2.0. The version is now 0.2.0 (build 2).

  • Shortcuts actions:
    • Turn On, with an optional duration or end time.
    • Turn Off.
    • Toggle, which returns the new state.
    • Is Wakeful On.
    • Get Time Left.
    • Change Time, which adds or removes time.
    • Siri phrases for turn on, turn off and toggle.
  • Global keyboard shortcut to turn on or off. You set it in Settings › General. It uses KeyboardShortcuts.
  • Until a time:
    • Until a Time… in the menu.
    • until=18:00 in the URL scheme.
    • End Time in Shortcuts.
    • A past time means tomorrow. The length is counted in real elapsed time, so it is right on daylight-saving days.
  • wakeful command-line tool in Wakeful.app/Contents/Helpers:
    • Commands: on [DURATION | until HH:MM], off, toggle, status.
    • It sends commands through the URL scheme, so it also starts the app when needed.
    • It confirms each command from state that the app writes to its defaults (state.* keys).
    • The Debug tool controls only the Debug app.
  • URL scheme: wakeful://activate?indefinitely.
  • Core:
    • Session.adjust(by:now:).
    • SessionDuration.until(hour:minute:now:calendar:) and SessionDuration(cli:).
    • Command.url(scheme:), which round-trips with Command(url:).

Test

  • swift test --package-path WakefulCore: 23 tests pass. New tests cover:
    • Until-time, including a daylight-saving day and a past time.
    • Time adjust: moving the end, removing past the end, and failing when off or indefinite.
    • CLI duration parsing.
    • URL round trips.
  • I ran all 6 actions from the Shortcuts app on a team-signed build:
    • Each one changed or returned the right state.
    • Change Time fails clearly when Wakeful is off or has no end time.
  • Global shortcut: I set ⌃⌥⌘W, pressed it twice, and Wakeful turned on, then off.
  • Until a Time…: the dialog opens at the next full hour and starts the session.
  • CLI: I ran every command and every error case, including starting the app when it was not running.
  • Left-click toggle: with real mouse clicks, a left-click toggles and a right-click opens the menu without toggling.
  • The notarized Release build was accepted by Apple. The CLI is signed with Developer ID and has hardened runtime on.

Notes

Shortcuts actions do not run on the ad-hoc signed Debug build, because macOS needs a team ID. CONTRIBUTING explains how to test them.

@duongdev
duongdev merged commit 38f8d71 into main Nov 14, 2026
3 checks passed
@duongdev
duongdev deleted the feat/0.2.0 branch December 1, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant