Skip to main content

Wakatime

Whatโ€‹

Shows the tracked time on wakatime of the current day

caution

You must request an API key at the wakatime website. The free tier for is sufficient. You'll find the API key in your profile settings page.

Sample Configurationโ€‹

{
"type": "wakatime",
"style": "powerline",
"powerline_symbol": "๎‚ฐ",
"foreground": "#ffffff",
"background": "#007acc",
"properties": {
"url": "https://wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key=API_KEY",
"cache_timeout": 10,
"http_timeout": 500
}
}

Propertiesโ€‹

NameTypeDefaultDescription
urlstringThe Wakatime summaries URL, including the API key. Example above.
http_timeoutint20The time (in milliseconds, ms) it takes to consider an http request as timed-out. If no segment is shown, try increasing this timeout.
cache_timeoutint10The time (in minutes, m) it takes to invalidate/renew the Wakatime segment output. Setting this to 0 disables the cache and requests to the API everytime the user presses the Enter key.

Dynamic API Keyโ€‹

If you don't want to include the API key into your configuration, the following modification can be done.

"properties": {
"url": "https://wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key={{ .Env.WAKATIME_API_KEY }}",
"cache_timeout": 10,
"http_timeout": 500
}
note

WAKATIME_API_KEY is an example, any name is possible and acceptable as long as the environment variable exists and contains the API key value.

Please refer to the Environment Variable page for more information.

Template (info)โ€‹

default template
{{ secondsRound .CumulativeTotal.Seconds }}

Propertiesโ€‹

NameTypeDescription
.CumulativeTotalwtTotalsobject holding total tracked time values

wtTotals Propertiesโ€‹

NameTypeDescription
.Secondsfloat64a number representing the total tracked time in seconds
.Textstringa string with human readable tracked time (eg: "2 hrs 30 mins")