# Calendar and Reminders on the session bus (Linux) While Skykeep runs, desktop shells and widgets (Quickshell, Waybar, KDE and GNOME widgets, your own shell) can read today's events and reminders, tick reminders off and open Skykeep on an item over D-Bus. Nothing is spawned and nothing polls: a widget reads once, then reads again when Skykeep says something changed. The answers are the same JSON the [`skykeep` command](cli.md) writes, with the same fields, so a widget can switch between the two. | | | |---|---| | Bus | Session bus only | | Name | `io.github.yashwanthkamireddi.Skykeep.Today` | | Object | `/io/github/yashwanthkamireddi/Skykeep/Today` | | Interface | `io.github.yashwanthkamireddi.Skykeep.Today1` | The name exists only while Skykeep is running. Calling it never starts Skykeep. To know when it comes and goes, watch `NameOwnerChanged` for the name, and read everything again when it appears. ## Reading Each method returns a JSON string. Times are seconds since 1970 (UTC). | Method | Same as | Answers | |---|---|---| | `Events(u days) → s` | `skykeep --events --days N` | Events from now for 1 to 366 days, including one already running | | `RemindersToday() → s` | `skykeep --reminders-today` | Reminders due today or overdue | | `Reminders(s list) → s` | `skykeep --reminders ` | A list's reminders that aren't done, with or without a date | | `ReminderLists() → s` | `skykeep --reminder-lists` | Your reminder lists in use | | `Calendars() → s` | `skykeep --calendars` | Your calendars | The fields of each item are listed in [cli.md](cli.md#reading). Field names don't change; new fields may be added, so ignore any you don't know. A change that isn't an addition would come as a new interface (`Today2`) beside this one. ## Doing | Method | Does | |---|---| | `CompleteReminder(s id)` | Ticks a reminder off. It's shown at once in Skykeep and sent to iCloud, as a tick in Reminders is. Asking again does nothing. | | `UncompleteReminder(s id)` | Puts a ticked reminder back. | | `OpenEvent(s id)` | Opens Calendar on the event's day, with the event open | | `OpenReminder(s id)` | Opens Reminders in the reminder's list, with the reminder open | | `OpenReminderList(s id)` | Opens Reminders showing the list | | `OpenApp(s app)` | Opens `calendar` or `reminders` (for a widget's header) | Nothing else can be changed over the bus. An id that isn't in your library, a list not in use or a day count outside 1 to 366 is refused with `org.freedesktop.DBus.Error.InvalidArgs` and changes nothing. If the library can't be read, the error is `org.freedesktop.DBus.Error.Failed`. ## Changed `Changed(as services)` is sent whenever Skykeep's own windows are told that Calendar or Reminders changed: a sync stored something new, an edit was sent to iCloud, or a reminder was ticked anywhere (in a window, from a notification, the command line or this bus). `services` holds `"calendar"`, `"reminders"` or both. Read again only what you show of those named. ## Examples ```sh # Today's reminders and the next three days of events busctl --user call io.github.yashwanthkamireddi.Skykeep.Today \ /io/github/yashwanthkamireddi/Skykeep/Today \ io.github.yashwanthkamireddi.Skykeep.Today1 RemindersToday busctl --user call io.github.yashwanthkamireddi.Skykeep.Today \ /io/github/yashwanthkamireddi/Skykeep/Today \ io.github.yashwanthkamireddi.Skykeep.Today1 Events u 3 # The JSON alone (busctl's --json output wraps the string) busctl --user --json=short call io.github.yashwanthkamireddi.Skykeep.Today \ /io/github/yashwanthkamireddi/Skykeep/Today \ io.github.yashwanthkamireddi.Skykeep.Today1 RemindersToday | jq -r '.data[0]' | jq . # Tick one off, and open Calendar on an event busctl --user call io.github.yashwanthkamireddi.Skykeep.Today \ /io/github/yashwanthkamireddi/Skykeep/Today \ io.github.yashwanthkamireddi.Skykeep.Today1 CompleteReminder s 6F1C… gdbus call --session --dest io.github.yashwanthkamireddi.Skykeep.Today \ --object-path /io/github/yashwanthkamireddi/Skykeep/Today \ --method io.github.yashwanthkamireddi.Skykeep.Today1.OpenEvent 9A3E… # Watch for changes gdbus monitor --session --dest io.github.yashwanthkamireddi.Skykeep.Today \ --object-path /io/github/yashwanthkamireddi/Skykeep/Today dbus-monitor --session "type='signal',interface='io.github.yashwanthkamireddi.Skykeep.Today1',member='Changed'" # See the interface busctl --user introspect io.github.yashwanthkamireddi.Skykeep.Today \ /io/github/yashwanthkamireddi/Skykeep/Today ``` A widget should subscribe to `Changed` with a match rule on the interface and member, call the reads once when the name appears and again on each `Changed`, and redraw. Nothing is sent while nothing changes.