Strava
Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →
Qué hace
Strava es un popular rastreador de actividades para ciclismo, running o cualquier otro entrenamiento. Para mantener tus objetivos de entrenamiento es importante recibir recordatorios. Un segmento de Oh My Posh para Strava muestra tu última actividad y puede indicar mediante un color si es hora de alejarte de tu computadora y activarte.
Acceso a tus datos de Strava
Para permitir que Oh My Posh acceda a tus datos de Strava, debes otorgar permiso para leer tus actividades públicas. Esto generará un token de acceso y un token de actualización. Pega estos tokens en la configuración de tu segmento Strava.
Haz clic en el siguiente enlace para conectarte con Strava:
Configuración de ejemplo
Esta configuración establece el fondo en verde si tuviste actividad en los últimos dos días,
naranja si fue en los últimos 5 días, y rojo en otro caso. El ejemplo de foreground_templates podría configurarse con un solo color
si ese color es visible sobre cualquiera de tus fondos.
- 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
Opciones
| 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 |
Plantilla (info)
{{ if .Error }}{{ .Error }}{{ else }}{{ .Ago }}{{ end }}
Propiedades
| 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 |
¡Ahora sal y disfruta de un paseo o carrera divertida!