Strava
Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden โ
Watโ
Strava is een populaire activiteitentracker voor fietsen, hardlopen of andere trainingen. Om je trainingsdoelen bij te houden is het belangrijk om hieraan herinnerd te worden. Een Oh My Posh Strava-segment toont je laatste activiteit, en geeft met een kleuraanduiding aan of het tijd is om van je computer weg te gaan en actief te worden.
Toegang tot je Strava-gegevensโ
Om Oh My Posh toegang te geven tot je Strava-gegevens moet je toestemming geven om je openbare activiteiten te lezen. Dit geeft je een toegangstoken en een verversingstoken. Plak deze tokens in je Strava-segmentconfiguratie.
Klik op de volgende link om verbinding te maken met Strava:
Voorbeeldconfiguratieโ
Deze configuratie maakt de achtergrond groen als je in de afgelopen twee dagen een activiteit hebt gehad,
oranje als je er een in de afgelopen vijf dagen hebt gehad, en rood in andere gevallen. Het foreground_templates-voorbeeld hieronder kan op รฉรฉn kleur worden ingesteld,
mits die kleur zichtbaar is tegen elke mogelijke achtergrond.
- json
- yaml
- toml
{
"type": "strava",
"style": "powerline",
"powerline_symbol": "๎ฐ",
"foreground": "#ffffff",
"background": "#000000",
"background_templates": [
"{{ if gt .Hours 100 }}#dc3545{{ end }}",
"{{ if and (lt .Hours 100) (gt .Hours 50) }}#ffc107{{ end }}",
"{{ if lt .Hours 50 }}#28a745{{ end }}"
],
"foreground_templates": [
"{{ if gt .Hours 100 }}#FFFFFF{{ end }}",
"{{ if and (lt .Hours 100) (gt .Hours 50) }}#343a40{{ end }}",
"{{ if lt .Hours 50 }}#FFFFFF{{ end }}"
],
"template": " ๎ต {{.Name}} {{.Ago}} {{.Icon}} ",
"options": {
"access_token": "11111111111111111",
"refresh_token": "1111111111111111",
"http_timeout": 1500
}
}
type: strava
style: powerline
powerline_symbol: ๎ฐ
foreground: "#ffffff"
background: "#000000"
background_templates:
- "{{ if gt .Hours 100 }}#dc3545{{ end }}"
- "{{ if and (lt .Hours 100) (gt .Hours 50) }}#ffc107{{ end }}"
- "{{ if lt .Hours 50 }}#28a745{{ end }}"
foreground_templates:
- "{{ if gt .Hours 100 }}#FFFFFF{{ end }}"
- "{{ if and (lt .Hours 100) (gt .Hours 50) }}#343a40{{ end }}"
- "{{ if lt .Hours 50 }}#FFFFFF{{ end }}"
template: " ๎ต {{.Name}} {{.Ago}} {{.Icon}} "
options:
access_token: "11111111111111111"
refresh_token: "1111111111111111"
http_timeout: 1500
type = "strava"
style = "powerline"
powerline_symbol = "๎ฐ"
foreground = "#ffffff"
background = "#000000"
background_templates = [ "{{ if gt .Hours 100 }}#dc3545{{ end }}", "{{ if and (lt .Hours 100) (gt .Hours 50) }}#ffc107{{ end }}", "{{ if lt .Hours 50 }}#28a745{{ end }}" ]
foreground_templates = [ "{{ if gt .Hours 100 }}#FFFFFF{{ end }}", "{{ if and (lt .Hours 100) (gt .Hours 50) }}#343a40{{ end }}", "{{ if lt .Hours 50 }}#FFFFFF{{ end }}" ]
template = " ๎ต {{.Name}} {{.Ago}} {{.Icon}} "
[options]
access_token = "11111111111111111"
refresh_token = "1111111111111111"
http_timeout = 1500
Optiesโ
| Name | Type | Default | Description |
|---|---|---|---|
access_token | template | token from Strava login, see login link in section above. | |
refresh_token | template | token from Strava login, see login link in section above. | |
expires_in | int | 0 | the default timeout of the token from the Strava login |
http_timeout | int | 20 | in milliseconds - how long do you want to wait before you want to see your prompt more than your strava data? |
ride_icon | string | \uf206 | |
run_icon | string | \ue213 | |
skiing_icon | string | \ue213 | |
workout_icon | string | \ue213 | |
unknown_activity_icon | string | \ue213 |
Template (informatie)โ
{{ if .Error }}{{ .Error }}{{ else }}{{ .Ago }}{{ end }}
Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.ID | time | The id of the entry |
.DateString | time | The timestamp of the entry |
.Type | string | Activity types as used in strava |
.UtcOffset | int | The UTC offset |
.Hours | int | Number of hours since last activity |
.Name | string | The name of the activity |
.Duration | float64 | Total duration in seconds |
.Distance | float64 | Total distance in meters |
.DeviceWatts | bool | Device has watts |
.AverageWatts | float64 | Average watts |
.WeightedAverageWatts | float64 | Weighted average watts |
.AverageHeartRate | float64 | Average heart rate |
.MaxHeartRate | float64 | Max heart rate |
.KudosCount | int | Kudos count |
.Icon | string | Activity based icon |
Ga er nu op uit voor een leuke rit of loop!