workrave icon indicating copy to clipboard operation
workrave copied to clipboard

[Feature Request] Workrave CLI/API for external integrations

Open douglasg14b opened this issue 2 years ago • 2 comments

I use workrave, but it's missing some things, and instead of hoping the dev can get to them (I'm not a C++ dev unfortunately.... C# is my jam), it would be great if there was an API or a CLI that could be used to integrate with workrave.

For instance, some "things" I would enjoy writing my own integrations for would be:

  • Networking, server & client, sharing workrave stats & timers between devices
    • I often juggle between devices and keeping myself accountable to breaks between them would be a fun, low-priority, "nice to have"
  • Better statistics
    • Keeping detailed statistics in say an SQLite DB, with CSV exports
    • Building my own stats dashboard that tracks my realtime activity

...etc

Options are endless if other devs can start building their own flavors on top of it in their favorite languages!

douglasg14b avatar Dec 04 '21 22:12 douglasg14b

Workrave has an undocumented DBus interface that allows you to change all settings, perform menu actions, retrieve timer/break state, inject user activity (e.g. to make a face detect activity monitor and has events for break state changes. Version 1.10 does not support DBus on Windows, but I will add Windows DBus support in V1.11 (development snapshots available from https://workrave.org/snapshots/. Noty sure how stable they are at the moment...) DBus implementation for C# are available :-) If any functionality is missing, I can try to add it.

The current networking support will be removed from 1.11 because it is way too complicated and doesn't work reliably. Someday I will implement a replacement. Probably more cloud based.

Switching to SQLite for the statistics is also a good idea. Likely to happen someday.

rcaelers avatar Dec 07 '21 18:12 rcaelers