Skip to content

Repository files navigation

sp-count-tray

Tests License Platform Go CGO

Shows how many tasks you have left in the Windows notification area, so you can see it without switching windows. The icon is the number: orange for today, blue for the total, green when no open tasks remain, and grey when the last refresh failed.

Left-click opens Super Productivity, or brings it to the front if it is already running. Right-click opens the menu, including an option to start this app with Windows.

What you need

Super Productivity, running, with its local REST API switched on:

Settings > Misc > Enable local REST API

That is the only setup step. The access token is found for you.

Get it running

go build -ldflags "-H=windowsgui -s -w" -o sp-count-tray.exe .
./sp-count-tray.exe

If the icon shows a grey !, run it with -check: it prints what it resolved and what went wrong, without starting a tray.

About the token

The API is protected by a bearer token, and this app reads the one Super Productivity writes:

%APPDATA%\superProductivity\local-rest-api-token

That is the mechanism Super Productivity provides for local tools; its own documentation notes that any process running as you can read it. The token is sent only to -endpoint, which defaults to loopback, and is never logged, echoed, or written anywhere else.

If you would rather supply it yourself, pass -token (or set SP_TOKEN) and the file is never opened. You can invalidate it at any time under Settings > Misc > Access Token.

Flags

Flag Default Meaning
-mode today Which count to show: today or total. Also in the menu.
-style badge How the count is drawn: badge or plain. Also in the menu.
-endpoint http://127.0.0.1:3876 Base URL of the local REST API.
-interval 30s How often to refresh; must be at least 5s.
-token unset Access token; wins over $SP_TOKEN and the token file.
-token-file unset File to read the access token from.
-sp-exe auto-detected Super Productivity's executable, for left-click to open.
-check false Print the resolved configuration and one API result, then exit.

Notes

  • Today counts tasks scheduled for today; Total counts everything still open. Completed tasks are never counted either way.
  • The scope and style you pick from the menu are saved in %APPDATA%\sp-count-tray\settings.json and reused on the next start. Explicit -mode and -style flags override the saved values for that run.
  • Start with Windows registers the current executable for the current Windows user. It uses the normal defaults when launched at sign-in and does not store access tokens in the registry.
  • Windows only for now.

Tests

go test -cover ./... reports 53.7% of statements. The drawing, API, credential and settings logic is covered; the tray lifecycle is not, because it needs a live notification area.

About

Windows tray icon showing Super Productivity task counts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages