Strava
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
Description
Strava est un tracker d'activité populaire pour le vélo, la course ou tout autre entraînement. Pour atteindre vos objectifs d'entraînement, il est important d'être rappelé de vos activités. Un segment Strava d'Oh My Posh affiche votre dernière activité et peut également indiquer par une couleur s'il est temps de quitter votre ordinateur pour bouger.
Accès à vos données Strava
Pour autoriser Oh My Posh à accéder à vos données Strava, vous devez lui donner accès en lecture à vos activités publiques. Cette opération génère un jeton d'accès et un jeton de rafraîchissement. Collez ces jetons dans la configuration de votre segment Strava.
Cliquez sur le lien suivant pour vous connecter à Strava :
Exemple de configuration
Cette configuration définit l'arrière-plan en vert si vous avez eu une activité ces deux derniers jours,
en orange si c'était dans les 5 derniers jours, et en rouge sinon. L'exemple foreground_templates ci-dessous pourrait être configuré avec une seule couleur,
à condition que cette couleur soit visible sur tous vos arrière-plans.
- 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
Options
| 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 |
Modèle (info)
{{ if .Error }}{{ .Error }}{{ else }}{{ .Ago }}{{ end }}
Propriétés
| 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 |
Maintenant, sortez et profitez d'une balade ou d'une course amusante !