<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!--
Written by lowtide, 2026. CC0 1.0: dedicated to the public domain.
Wake-ups: an app that isn't running is started for a moment at a time
it asked for, to do something small (ring a timer, check for mail,
update its tile, show a toast) and leave again. Nothing of the app
runs in between.
c8-shell serves this on the session bus as org.cont8nuum.Wake at
/org/cont8nuum/Wake, and keeps the list in
$XDG_STATE_HOME/cont8nuum/wakes.ini, so wakes outlive the app, the
shell and logging out. A wake that came due while the shell wasn't
running (the PC was off) runs as soon as it starts, late; a repeating
one runs once for all the times it missed.
When one is due the shell runs its command, through the compositor as
Start would, with three more arguments: the option c8-wake (with the
usual two dashes in front; a comment here can't hold them), the TAG
and DUE:
COMMAND... [dash dash]c8-wake TAG DUE
DUE is when it was meant to run (Unix seconds), so an app can tell a
late wake. A one-off wake is off the list before it runs; book it
again from the wake for another. A repeating one stays.
If the app is running already, that new copy hands the wake to it and
exits: c8ui apps (c8ui_app_main) do that by calling ActivateAction
("c8-wake", [<TAG>, <DUE as x>], {}) on its
org.freedesktop.Application, and the running copy gets it as if
started for it. Otherwise the copy runs without a window: c8ui gives
it WAKE_SECONDS (30) to finish, then it quits unless it has opened a
window by then. A toast it sends with a "desktop-entry" hint and no
"default" action opens the app when clicked (c8-shell's notify.c).
Calls are checked only for sense, not for who makes them: anything
on the session bus runs as the user anyway. An app is told apart by
its id, the name it owns on the bus and its desktop entry's name.
The shell looks at the list at most once a minute while nothing is
due sooner, and at the time a wake is due, so a wake runs within a
second of its time while the PC is awake; after a suspend, within a
minute of waking.
-->
<node>
<interface name="org.cont8nuum.Wake1">
<!--
Books a wake, or moves the one this app already has by that tag.
app: the app's id (org.example.Notes). tag: the app's own name
for it, letters, digits, "-", "_" and ".", up to 64. when: Unix
seconds; now or before runs at once. every: 0 for once, else
seconds between runs, at least 60. command: what to run, the
program and its first arguments (["c8-lua", "/path/main.lua"]).
At most 32 wakes an app.
-->
<method name="Set">
<arg name="app" type="s" direction="in"/>
<arg name="tag" type="s" direction="in"/>
<arg name="when" type="x" direction="in"/>
<arg name="every" type="u" direction="in"/>
<arg name="command" type="as" direction="in"/>
</method>
<!-- Takes a wake off the list; none by that tag is no error -->
<method name="Cancel">
<arg name="app" type="s" direction="in"/>
<arg name="tag" type="s" direction="in"/>
</method>
<!-- The app's wakes: tag, next time, every -->
<method name="List">
<arg name="app" type="s" direction="in"/>
<arg name="wakes" type="a(sxu)" direction="out"/>
</method>
</interface>
</node>