docs: tables for data

this look a lot better
This commit is contained in:
Jan De Dobbeleer 2022-09-16 16:32:48 +02:00 committed by Jan De Dobbeleer
parent 8d9fe9d3c8
commit 3057e474d7
73 changed files with 1290 additions and 1134 deletions

View file

@ -5,7 +5,7 @@ sidebar_label: Block
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem"
import TabItem from "@theme/TabItem";
Let's take a closer look at what defines a block.
@ -41,13 +41,11 @@ Let's take a closer look at what defines a block.
```yaml
# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
...
---
blocks:
- type: prompt
alignment: left
segments: [
...
]
segments: [...]
```
</TabItem>
@ -67,12 +65,16 @@ segments = [
</TabItem>
</Tabs>
- type: `prompt` | `rprompt`
- newline: `boolean`
- alignment: `left` | `right`
- filler: `string`
- overflow: `break` | `hide`
- segments: `array` of one or more `segments`
## Properties
| Name | Type |
| ----------- | --------- |
| `type` | `string` |
| `newline` | `boolean` |
| `alignment` | `string` |
| `filler` | `string` |
| `overflow` | `string` |
| `segments` | `array` |
### Type
@ -80,7 +82,7 @@ Tells the engine what to do with the block. There are two options:
- `prompt` renders one or more segments
- `rprompt` renders one or more segments aligned to the right of the cursor. Only one `rprompt` block is permitted.
Supported on zsh, bash, PowerShell, cmd and fish.
Supported on zsh, bash, PowerShell, cmd and fish.
### Newline
@ -88,6 +90,9 @@ Start the block on a new line - defaults to `false`.
### Alignment
- `left`
- `right`
Tell the engine if the block should be left or right-aligned.
### Filler
@ -103,11 +108,15 @@ to be repeated to this property. Add this property to the _right_ aligned block.
### Overflow
- `break`
- `hide`
When the right aligned block is so long it will overflow the left aligned block, the engine will either
break the block or hide it based on the setting. By default it is printed as is on the same line.
### Segments
Array of one or more segments.
Array of one or more [segments][segment].
[color-overrides]: /docs/configuration/colors#color-overrides
[segment]: segment.mdx

View file

@ -29,7 +29,7 @@ Oh My Posh supports multiple different color references, being:
## Color templates
Array of string templates to define the color based on the current context.
Array of string [templates][templates] to define the color based on the current context.
Under the hood this uses go's [text/template][go-text-template] feature extended with [sprig][sprig] and
offers a few standard properties to work with. For segments, you can look at the **Template Properties**
section in the documentation. The general template properties are listed [here][template-properties].
@ -196,3 +196,6 @@ For example, `p:foreground` and `p:background` will be correctly set to "#CAF0F8
[battery]: /docs/segments/battery
[template-properties]: /docs/configuration/templates#global-properties
[aws]: /docs/segments/aws
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/
[templates]: templates.mdx

View file

@ -32,25 +32,28 @@ You need to extend or create a custom theme with your debug prompt override. For
}
```
The configuration has the following properties:
## Properties
- foreground: `string` [color][colors]
- foreground_templates: foreground [color templates][color-templates]
- background: `string` [color][colors]
- background_templates: background [color templates][color-templates]
- template: `string` - a go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
properties below - defaults to `[DBG]: `
| Name | Type | Description |
| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `foreground` | `string` | [color][colors] |
| `foreground_templates` | `string` | [color templates][color-templates] |
| `background` | `string` | [color][colors] |
| `background_templates` | `string` | [color templates][color-templates] |
| `template` | `string` | a go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the properties below - defaults to `[DBG]: ` |
## Template ([info][templates])
- `.Root`: `boolean` - is the current user root/admin or not
- `.PWD`: `string` - the current working directory
- `.Folder`: `string` - the current working folder
- `.Shell`: `string` - the current shell name
- `.UserName`: `string` - the current user name
- `.HostName`: `string` - the host name
- `.Code`: `int` - the last exit code
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
| Name | Type | Description |
| -------------- | --------- | ------------------------------------------------------------------------- |
| `.Root` | `boolean` | is the current user root/admin or not |
| `.PWD` | `string` | the current working directory |
| `.Folder` | `string` | the current working folder |
| `.Shell` | `string` | the current shell name |
| `.UserName` | `string` | the current user name |
| `.HostName` | `string` | the host name |
| `.Code` | `int` | the last exit code |
| `.Env.VarName` | `string` | Any environment variable where `VarName` is the environment variable name |
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -16,8 +16,8 @@ is compatible with your config as **these values are only set once** on shell st
There are two config settings you need to tweak:
- `valid_line`: displays when the line is valid (again)
- `error_line`: displays when the line is faulty
- `valid_line`: displays when the line is valid (again)
- `error_line`: displays when the line is faulty
You can use go [text/template][go-text-template] templates extended with [sprig][sprig] to enrich the text.
All [template][templates] functionality is available, even reusing [cross segment template properties][cstp] from
@ -46,11 +46,13 @@ You need to extend or create a custom theme with your prompt overrides. For exam
}
```
The configuration has the following properties:
## Properties
- background: `string` [color][colors]
- foreground: `string` [color][colors]
- template: `string` - a fully featured [template][templates] - defaults to ` `
| Name | Type | Description |
| ------------ | -------- | ---------------------------------------------------------- |
| `background` | `string` | [color][colors] |
| `foreground` | `string` | [color][colors] |
| `template` | `string` | a fully featured [template][templates] - defaults to empty |
[colors]: /docs/configuration/colors
[go-text-template]: https://golang.org/pkg/text/template/

View file

@ -123,11 +123,12 @@ For example, the following is a valid `--config` flag:
## General Settings
- final_space: `boolean` - when true adds a space at the end of the prompt
- pwd: `string` - notify terminal of current working directory, values can be `osc99` or `osc7` depending on your terminal
- terminal_background: `string` [color][colors] - terminal background color, set to your terminal's background color when
you notice black elements in Windows Terminal or the Visual Studio Code integrated terminal
- accent_color: `string` [color][colors] - accent color, used as a fallback when the `accent` [color][accent] is not supported
| Name | Type | Description |
| --------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `final_space` | `boolean` | when true adds a space at the end of the prompt |
| `pwd` | `string` | notify terminal of current working directory, values can be `osc99` or `osc7` depending on your terminal |
| `terminal_background` | `string` | [color][colors] - terminal background color, set to your terminal's background color when you notice black elements in Windows Terminal or the Visual Studio Code integrated terminal |
| `accent_color` | `string` | [color][colors] - accent color, used as a fallback when the `accent` [color][accent] is not supported |
### JSON Schema Validation

View file

@ -31,19 +31,22 @@ You need to extend or create a custom theme with your secondary prompt override.
}
```
The configuration has the following properties:
## Properties
- background: `string` [color][colors]
- foreground: `string` [color][colors]
- template: `string` - a go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
properties below - defaults to `> `
| Name | Type | Description |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `background` | `string` | [color][colors] |
| `foreground` | `string` | [color][colors] |
| `template` | `string` | a go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the properties below - defaults to `> ` |
## Template ([info][templates])
- `.Root`: `boolean` - is the current user root/admin or not
- `.Shell`: `string` - the current shell name
- `.UserName`: `string` - the current user name
- `.HostName`: `string` - the host name
| Name | Type | Description |
| ----------- | --------- | ------------------------------------- |
| `.Root` | `boolean` | is the current user root/admin or not |
| `.Shell` | `string` | the current shell name |
| `.UserName` | `string` | the current user name |
| `.HostName` | `string` | the host name |
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -33,25 +33,23 @@ understand how to configure a segment.
}
```
- type: `string` any of the included [segments][segments]
- style: `powerline` | `plain` | `diamond` | `accordion`
- powerline_symbol: `string`
- invert_powerline: `boolean`
- leading_diamond: `string`
- trailing_diamond: `string`
- foreground: `string` [color][colors]
- foreground_templates: foreground [color templates][color-templates]
- background: `string` [color][colors]
- background_templates: background [color templates][color-templates]
- template: `string` a go [text/template][go-text-template] [template][templates] to render the prompt
- templates: `array` of `template`
- templates_logic: `first_match` | `join`
- properties: `array` of `Property`: `string`
- interactive: `boolean`
## Type
Takes the `string` value referencing which segment logic it needs to run (see [segments][segments] for possible values).
| Name | Type | Description |
| ---------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | `string` | takes the `string` value referencing which segment logic it needs to run (see [segments][segments] for possible values) |
| `style` | `string` | see [Style][style] below. Possible values:<ul><li>`powerline`</li><li>`plain`</li><li>`diamond`</li><li>`accordion`</li></ul> |
| `powerline_symbol` | `string` | character to use when `"style": "powerline"` |
| `invert_powerline` | `boolean` | if `true` swaps the foreground and background colors. Can be useful when the character you want does not exist in the perfectly mirrored variant for example - defaults to `false` |
| `leading_diamond` | `string` | character to use at the start of the segment. Will take the background color of the segment as its foreground color |
| `trailing_diamond` | `string` | character to use at the end of the segment. Will take the background color of the segment as its foreground color |
| `foreground` | `string` | [color][colors] |
| `foreground_templates` | `[]Template` | [color templates][color-templates] |
| `background` | `string` | [color][colors] |
| `background_templates` | `[]Template` | [color templates][color-templates] |
| `template` | `string` | a go [text/template][go-text-template] [template][templates] to render the prompt |
| `templates` | `[]Template` | in some cases having a single [template][templates] string is a bit cumbersome. Templates allows you to span the segment's [template][templates] string multiple lines where every [template][templates] is evaluated and depending on what you aim to achieve, there are two possible outcomes based on `templates_logic` |
| `templates_logic` | `string` | <ul><li>`first_match`: return the first non-whitespace string and skip everything else</li><li>`join`:evaluate all templates and join all non-whitespace strings (**default**)</li></ul> |
| `properties` | `[]Property` | see [Properties][properties] below |
| `interactive` | `boolean` | when is true, the segment text is not escaped to allow the use of interactive prompt escape sequences - defaults to `false` |
## Style
@ -81,51 +79,20 @@ segment background as their foreground color.
Same as Powerline except that it will display even when disabled, but without text. That way it seems
as if the segment is not expanded, just like an accordion.
## Powerline symbol
Text character to use when `"style": "powerline"`.
## Invert Powerline
If `true` this swaps the foreground and background colors. Can be useful when the character you want does not exist
in the perfectly mirrored variant for example.
## Leading diamond
Text character to use at the start of the segment. Will take the background color of the segment as
its foreground color.
## Trailing diamond
Text character to use at the end of the segment. Will take the background color of the segment as its foreground color.
## Template
A single line [template][templates] string leveraging a segment's properties to render the text.
## Templates
In some cases having a single [template][templates] string is a bit cumbersome. Templates allows you to span the
segment's [template][templates] string multiple lines where every [template][templates] is evaluated and depending
on what you aim to achieve, there are two possible outcomes based on `templates_logic`:
- `first_match`: return the first non-whitespace string and skip everything else
- `join`: evaluate all templates and join all non-whitespace strings
The default is `join`.
## Properties
An array of **Properties** with a value. This is used inside of the segment logic to tweak what the output of the segment
will be. Segments have the ability to define their own Properties, but there are some general ones being used by the
engine which allow you to customize the output even more.
An array of Properties with a value. This is used inside of the segment logic to tweak what the output of the segment will be.
Segments have the ability to define their own Properties, but there are some shared ones being used by the engine which allow
you to customize the output even more.
### General-purpose properties
### Shared properties
You can use these on any segment, the engine is responsible for adding them correctly.
- include_folders: `[]string`
- exclude_folders: `[]string`
| Name | Type |
| ----------------- | ---------- |
| `include_folders` | `[]string` |
| `exclude_folders` | `[]string` |
#### Include / Exclude Folders
@ -166,23 +133,21 @@ You can also combine these properties:
]
```
#### Interactive
When this is true, the segment text is not escaped to allow the use of interactive prompt escape sequences.
#### Notes
- Oh My Posh will accept both `/` and `\` as path separators for a folder and will match regardless of which
is used by the current operating system.
is used by the current operating system.
- Because the strings are evaluated as regular expressions, if you want to use a `\` in a Windows
directory name, you need to specify it as `\\\\`.
directory name, you need to specify it as `\\\\`.
- The character `~` at the start of a specified folder will match the user's home directory.
- The comparison is case-insensitive on Windows and macOS, but case-sensitive on other operating systems.
This means that for user Bill, who has a user account `Bill` on Windows and `bill` on Linux, `~/Foo` might match
This means that for user Bill, who has a user account `Bill` on Windows and `bill` on Linux, `~/Foo` might match
`C:\Users\Bill\Foo` or `C:\Users\Bill\foo` on Windows but only `/home/bill/Foo` on Linux.
[segments]: /docs/segments/angular
[properties]: #properties
[style]: #style
[colors]: /docs/configuration/colors
[go-text-template]: https://golang.org/pkg/text/template/
[sprig]: https://masterminds.github.io/sprig/

View file

@ -26,7 +26,9 @@ offers a few standard properties to work with.
## Environment variables
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
| Name | Type | Description |
| -------------- | -------- | ------------------------------------------------------------------------- |
| `.Env.VarName` | `string` | Any environment variable where `VarName` is the environment variable name |
:::tip
If you're using PowerShell, you can override a function to populate environment variables before the
@ -111,8 +113,8 @@ your config does not contain a git segment as Oh My Posh only populates the prop
You can make use of the following syntax to decorate text:
| Syntax | Description |
| ---------------------- | --------------------------------------------- |
| Syntax | Description |
| ---------------------- | ------------------------------------- |
| `<b>bold</b>` | `bold` as bold text |
| `<u>underline</u>` | `underline` as underlined text |
| `<o>overline</o>` | `overline` as overlined text |

View file

@ -37,8 +37,8 @@ You need to extend or create a custom theme with your tooltips. For example:
"style": "diamond",
"foreground": "#193549",
"background": "#fffb38",
"leading_diamond": "",
"trailing_diamond": "",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0b4",
"template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}",
"properties": {
"fetch_status": true,

View file

@ -24,7 +24,6 @@ By enabling Transient Prompt, you can replace the prompt with some other content
![After Transient](/img/transient-after.gif)
## Configuration
You need to extend or create a custom theme with your transient prompt. For example:
@ -43,13 +42,15 @@ You need to extend or create a custom theme with your transient prompt. For exam
}
```
The configuration has the following properties:
## Properties
- foreground: `string` [color][colors]
- foreground_templates: foreground [color templates][color-templates]
- background: `string` [color][colors]
- background_templates: background [color templates][color-templates]
- template: `string` - a fully featured [template][templates] - defaults to `{{ .Shell }}> `
| Name | Type | Description |
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `foreground` | `string` | [color][colors] |
| `foreground_templates` | `array` | [color templates][color-templates] |
| `background` | `string` | [color][colors] |
| `background_templates` | `array` | [color templates][color-templates] |
| `template` | `string` | a go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the properties below - defaults to `{{ .Shell }}> ` |
## Enable the feature

View file

@ -116,7 +116,9 @@ Display something new.
## Properties
- newprop: `string` - the new text to show - defaults to `\uEFF1`
| Name | Type | Description |
| --------- | -------- | ------------------------------------------- |
| `newprop` | `string` | the new text to show - defaults to `\uEFF1` |
````
## Map the new documentation in the sidebar

View file

@ -23,19 +23,18 @@ Display the currently active [Angular CLI][angular-cli-docs] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the active version or not; useful if all you need is an icon indicating `ng`
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `angular.json` file is present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the active version or not; useful if all you need is an icon indicating `ng` |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `angular.json` file is present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -43,12 +42,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,14 +23,17 @@ Display the currently active AWS profile and region.
## Properties
- display_default: `boolean` - display the segment or not when the user profile matches `default` - defaults
| Name | Type | Description |
| ----------------- | ------------------------------------------------------------------------------ | ----------- |
| `display_default` | `boolean` - display the segment or not when the user profile matches `default` | defaults |
to `true`
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }}
```
@ -38,7 +41,9 @@ to `true`
### Properties
- `.Profile`: `string` - the currently active profile
- `.Region`: `string` - the currently active region
| Name | Type | Description |
| ---------- | -------- | ---------------------------- |
| `.Profile` | `string` | the currently active profile |
| `.Region` | `string` | the currently active region |
[templates]: /docs/configuration/templates

View file

@ -23,16 +23,15 @@ Display the currently active Azure subscription information.
## Properties
- source: `string` - where to fetch the information from - defaults to `first_match`
- `first_match`: try the CLI config first, then the PowerShell module. The first to resolve is displayed
- `cli`: fetch the information from the CLI config
- `pwsh`: fetch the information from the PowerShell Module config
| Name | Type | Description |
| -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `source` | `string` | <ul><li>`first_match`: try the CLI config first, then the PowerShell module. The first to resolve is displayed (**default**)</li><li>`cli`: fetch the information from the CLI config</li><li>`pwsh`: fetch the information from the PowerShell Module config</li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Name }}
```
@ -40,15 +39,17 @@ Display the currently active Azure subscription information.
### Properties
- `.EnvironmentName`: `string` - account environment name
- `.HomeTenantID`: `string` - home tenant id
- `.ID`: `string` - account/subscription id
- `.IsDefault`: `boolean` - is the default account or not
- `.Name`: `string` - account name
- `.State`: `string` - account state
- `.TenantID`: `string` - tenant id
- `.User.Name`: `string` - user name
- `.User.Type`: `string` - user type
- `.Origin`: `string` - where we received the information from, can be `CLI` or `PWSH`
| Name | Type | Description |
| ------------------ | --------- | -------------------------------------------------------------- |
| `.EnvironmentName` | `string` | account environment name |
| `.HomeTenantID` | `string` | home tenant id |
| `.ID` | `string` | account/subscription id |
| `.IsDefault` | `boolean` | is the default account or not |
| `.Name` | `string` | account name |
| `.State` | `string` | account state |
| `.TenantID` | `string` | tenant id |
| `.User.Name` | `string` | user name |
| `.User.Type` | `string` | user type |
| `.Origin` | `string` | where we received the information from, can be `CLI` or `PWSH` |
[templates]: /docs/configuration/templates

View file

@ -12,33 +12,33 @@ Display the currently active [Azure Functions CLI][az-func-core-tools] version.
```json
{
"type": "azfunc",
"style": "powerline",
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#FEAC19",
"template": " \uf0e7 {{ .Full }} ",
"properties": {
"fetch_version": true,
"display_mode": "files"
}
"type": "azfunc",
"style": "powerline",
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#FEAC19",
"template": " \uf0e7 {{ .Full }} ",
"properties": {
"fetch_version": true,
"display_mode": "files"
}
}
```
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the Azure Functions CLI version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when a `host.json` or `local.settings.json` files is present (default)
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the Azure Functions CLI version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when a `host.json` or `local.settings.json` files is present (**default**)</li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -46,11 +46,13 @@ Display the currently active [Azure Functions CLI][az-func-core-tools] version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
[templates]: /docs/configuration/templates
[az-func-core-tools]: https://github.com/Azure/azure-functions-core-tools

View file

@ -37,17 +37,19 @@ Battery displays the remaining power percentage for your battery.
## Properties
- display_error: `boolean` - show the error context when failing to retrieve the battery information - defaults to `false`
- charging_icon: `string` - icon to display when charging - defaults to empty
- discharging_icon: `string` - icon to display when discharging - defaults to empty
- charged_icon: `string` - icon to display when fully charged - defaults to empty
- not_charging_icon: `string` - icon to display when fully charged - defaults to empty
| Name | Type | Description |
| ------------------- | --------- | --------------------------------------------------------------------------------------------- |
| `display_error` | `boolean` | show the error context when failing to retrieve the battery information - defaults to `false` |
| `charging_icon` | `string` | icon to display when charging - defaults to empty |
| `discharging_icon` | `string` | icon to display when discharging - defaults to empty |
| `charged_icon` | `string` | icon to display when fully charged - defaults to empty |
| `not_charging_icon` | `string` | icon to display when fully charged - defaults to empty |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}
```
@ -55,20 +57,18 @@ Battery displays the remaining power percentage for your battery.
### Properties
- `.State`: `struct` - the battery state, has a `.String` function
- `.Current`: `float64` - Current (momentary) charge rate (in mW).
- `.Full`: `float64` - Last known full capacity (in mWh)
- `.Design`: `float64` - Reported design capacity (in mWh)
- `.ChargeRate`: `float64` - Current (momentary) charge rate (in mW). It is always non-negative, consult .State
field to check whether it means charging or discharging (on some systems this might be always `0` if the battery
doesn't support it)
- `.Voltage`: `float64` - Current voltage (in V)
- `.DesignVoltage`: `float64` - Design voltage (in V). Some systems (e.g. macOS) do not provide a separate
value for this. In such cases, or if getting this fails, but getting `Voltage` succeeds, this field will have
the same value as `Voltage`, for convenience
- `.Percentage`: `float64` - the current battery percentage
- `.Error`: `string` - the error in case fetching the battery information failed
- `.Icon`: `string` - the icon based on the battery state
| Name | Type | Description |
| ---------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.State` | `struct` | the battery state, has a `.String` function |
| `.Current` | `float64` | Current (momentary) charge rate (in mW). |
| `.Full` | `float64` | Last known full capacity (in mWh) |
| `.Design` | `float64` | Reported design capacity (in mWh) |
| `.ChargeRate` | `float64` | Current (momentary) charge rate (in mW). It is always non-negative, consult .State field to check whether it means charging or discharging (on some systems this might be always `0` if the battery doesn't support it) |
| `.Voltage` | `float64` | Current voltage (in V) |
| `.DesignVoltage` | `float64` | Design voltage (in V). Some systems (e.g. macOS) do not provide a separate value for this. In such cases, or if getting this fails, but getting `Voltage` succeeds, this field will have the same value as `Voltage`, for convenience |
| `.Percentage` | `float64` | the current battery percentage |
| `.Error` | `string` | the error in case fetching the battery information failed |
| `.Icon` | `string` | the icon based on the battery state |
[colors]: /docs/configuration/colors
[battery]: https://github.com/distatus/battery/blob/master/battery.go#L78

View file

@ -6,7 +6,7 @@ sidebar_label: Brewfather
## What
Calling all brewers! Keep up-to-date with the status of your [Brewfather][brewfather] batch directly in your
Calling all brewers! Keep up-to-date with the status of your [Brewfather][brewfather] batch directly in your
commandline prompt using the brewfather segment!
You will need your User ID and API Key as generated in
@ -41,38 +41,45 @@ NOTE: Temperature units are in degrees C and specific gravity is expressed as `X
## Properties
- user_id: `string` - as provided by Brewfather's Generate API Key screen.
- api_key: `string` - as provided by Brewfather's Generate API Key screen.
- batch_id: `string` - Get this by navigating to the desired batch on the brewfather website,
the batch id is at the end of the URL in the address bar.
- http_timeout: `int` in milliseconds - How long to wait for the Brewfather service to answer the request. Default 2 seconds.
- cache_timeout: `int` in minutes - How long to wait before updating the data from Brewfather. Default is 5 minutes.
- day_icon: `string` - icon or letter to use to indicate days. Default is "d".
| Name | Type | Description |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `user_id` | `string` | as provided by Brewfather's Generate API Key screen |
| `api_key` | `string` | as provided by Brewfather's Generate API Key screen |
| `batch_id` | `string` | Get this by navigating to the desired batch on the brewfather website, the batch id is at the end of the URL in the address bar |
| `http_timeout` | `int` | in milliseconds - How long to wait for the Brewfather service to answer the request. Default 2 seconds |
| `cache_timeout` | `int` | in minutes - How long to wait before updating the data from Brewfather. Default is 5 minutes |
| `day_icon` | `string` | icon or letter to use to indicate days. Default is "d" |
## Icons
You can override the icons for temperature trend as used by template property `.TemperatureTrendIcon` with:
- doubleup_icon - for increases of more than 4°C, default is ↑↑
- singleup_icon - increase 2-4°C, default is ↑
- fortyfiveup_icon - increase 0.5-2°C, default is ↗
- flat_icon - change less than 0.5°C, default is →
- fortyfivedown_icon - decrease 0.5-2°C, default is ↘
- singledown_icon - decrease 2-4°C, default is ↓
- doubledown_icon - decrease more than 4°C, default is ↓↓
| Name | Description |
| -------------------- | ----------------------------------------------- |
| `doubleup_icon` | for increases of more than 4°C, default is `↑↑` |
| `singleup_icon` | increase 2-4°C, default is `↑` |
| `fortyfiveup_icon` | increase 0.5-2°C, default is `↗` |
| `flat_icon` | change less than 0.5°C, default is `→` |
| `fortyfivedown_icon` | decrease 0.5-2°C, default is `↘` |
| `singledown_icon` | decrease 2-4°C, default is `↓` |
| `doubledown_icon` | decrease more than 4°C, default is `↓↓` |
You can override the default icons for batch status as used by template property `.StatusIcon` with:
- planning_status_icon
- brewing_status_icon
- fermenting_status_icon
- conditioning_status_icon
- completed_status_icon
- archived_status_icon
| Name |
| -------------------------- |
| `planning_status_icon` |
| `brewing_status_icon` |
| `fermenting_status_icon` |
| `conditioning_status_icon` |
| `completed_status_icon` |
| `archived_status_icon` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .StatusIcon }} {{ if .DaysBottledOrFermented }}{{ .DaysBottledOrFermented }}{{ .DayIcon }} {{ end }}{{ url .Recipe.Name .URL }} {{ printf \"%.1f\" .MeasuredAbv }}%{{ if and (.Reading) (eq .Status \"Fermenting\") }} {{ printf \"%.3f\" .Reading.Gravity }} {{ .Reading.Temperature }}\u00b0 {{ .TemperatureTrendIcon }}{{ end }}
```
@ -80,65 +87,71 @@ You can override the default icons for batch status as used by template property
### Properties
Commonly used fields
| Name | Type | Description |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| .Status | `string` | One of "Planning", "Brewing", "Fermenting", "Conditioning", "Completed" or "Archived" |
| .StatusIcon | `string` | Icon representing above stats. Can be overridden with properties shown above |
| .TemperatureTrendIcon | `string` | Icon showing temperature trend based on latest and previous reading |
| .DaysFermenting | `int` | days since start of fermentation |
| .DaysBottled | `int` | days since bottled/kegged |
| .DaysBottledOrFermented | `int` | one of the above, chosen automatically based on batch status |
| .Recipe.Name | `string` | The recipe being brewed in this batch |
| .BatchName | `string` | The name of this batch |
| .BatchNumer | `int` | The number of this batch |
| .MeasuredAbv | `float` | The ABV for the batch - either estimated from recipe or calculated from entered OG and FG values |
| .ReadingAge | `int` | age in hours of most recent reading or -1 if there are no readings available |
- .Status: `string` - One of "Planning", "Brewing", "Fermenting", "Conditioning", "Completed" or "Archived"
- .StatusIcon `string` - Icon representing above stats. Can be overridden with properties shown above
- .TemperatureTrendIcon `string` - Icon showing temperature trend based on latest and previous reading
- .DaysFermenting `int` - days since start of fermentation
- .DaysBottled `int` - days since bottled/kegged
- .DaysBottledOrFermented `int` - one of the above, chosen automatically based on batch status
- .Recipe.Name: `string` - The recipe being brewed in this batch
- .BatchName `string` - The name of this batch
- .BatchNumer `int` - The number of this batch
- .MeasuredAbv: `float` - The ABV for the batch - either estimated from recipe or calculated from entered OG and FG values
- .ReadingAge `int` - age in hours of most recent reading or -1 if there are no readings available
#### Reading
.Reading contains the most recent data from devices or manual entry as visible on the Brewfather's batch Readings graph.
If there are no readings available, .Reading will be null.
`.Reading` contains the most recent data from devices or manual entry as visible on the Brewfather's batch Readings graph.
If there are no readings available, `.Reading` will be null.
- .Reading.Gravity: `float` - specific gravity (in decimal point format)
- .Reading.Temperature `float` - temperature in °C
- .Reading.Time `int` - unix timestamp of reading
- .Reading.Comment `string` - comment attached to this reading
- .Reading.DeviceType `string` - source of the reading, e.g. "Tilt"
- .Reading.DeviceID `string` - id of the device, e.g. "PINK"
| Name | Type | Description |
| -------------------- | -------- | ------------------------------------------ |
| .Reading.Gravity | `float` | specific gravity (in decimal point format) |
| .Reading.Temperature | `float` | temperature in °C |
| .Reading.Time | `int` | unix timestamp of reading |
| .Reading.Comment | `string` | comment attached to this reading |
| .Reading.DeviceType | `string` | source of the reading, e.g. "Tilt" |
| .Reading.DeviceID | `string` | id of the device, e.g. "PINK" |
Additional template properties
#### Additional properties
- .MeasuredOg: `float` - The OG for the batch as manually entered into Brewfather
- .MeasuredFg: `float` -The FG for the batch as manually entered into Brewfather
- .BrewDate: `int` - The unix timestamp of the brew day
- .FermentStartDate: `int` The unix timestamp when fermentation was started
- .BottlingDate: `time` - The unix timestamp when bottled/kegged
- .TemperatureTrend `float` - The difference between the most recent and previous temperature in °C
- .DayIcon `string` - given by "day_icon", or "d" by default
| Name | Type | Description |
| ----------------- | -------- | --------------------------------------------------------------------- |
| .MeasuredOg | `float` | The OG for the batch as manually entered into Brewfather |
| .MeasuredFg | `float` | The FG for the batch as manually entered into Brewfather |
| .BrewDate | `int` | The unix timestamp of the brew day |
| .FermentStartDate | `int` | The unix timestamp when fermentation was started |
| .BottlingDate | `time` | The unix timestamp when bottled/kegged |
| .TemperatureTrend | `float` | The difference between the most recent and previous temperature in °C |
| .DayIcon | `string` | given by "day_icon", or "d" by default |
Hyperlink support
#### Hyperlink support
- .URL `string` - the URL for the batch in the Brewfather app. You can use this to add a hyperlink to the segment
if you are using a terminal that supports it. The default template implements this.
| Name | Type | Description |
| ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.URL` | `string` | the URL for the batch in the Brewfather app. You can use this to add a hyperlink to the segment if you are using a terminal that supports it. The default template implements this |
Hyperlink formatting example
Hyperlink formatting example
````json
{
// General format: [Text](Url)
"template":"[{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d{{end}} {{.Recipe.Name}}]({{.URL}})"
}
````
```json
{
// General format: [Text](Url)
"template": "[{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}d{{end}} {{.Recipe.Name}}]({{.URL}})"
}
```
### Advanced Templating
The built in template will provides key useful information. However, you can use the properties about the batch
to build your own. For reference, the built-in template looks like this:
The built in template will provides key useful information. However, you can use the properties about the batch
to build your own. For reference, the built-in template looks like this:
````json
{
"template":"{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}{{.DayIcon}} {{end}}[{{.Recipe.Name}}]({{.URL}}) {{printf \"%.1f\" .MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{printf \"%.3f\" .Reading.Gravity}} {{.Reading.Temperature}}\u00b0 {{.TemperatureTrendIcon}}{{end}}"
}
````
```json
{
"template": "{{.StatusIcon}} {{if .DaysBottledOrFermented}}{{.DaysBottledOrFermented}}{{.DayIcon}} {{end}}[{{.Recipe.Name}}]({{.URL}}) {{printf \"%.1f\" .MeasuredAbv}}%{{ if and (.Reading) (eq .Status \"Fermenting\")}}: {{printf \"%.3f\" .Reading.Gravity}} {{.Reading.Temperature}}\u00b0 {{.TemperatureTrendIcon}}{{end}}"
}
```
### Unit conversion
@ -148,32 +161,36 @@ The following conversion functions are available to the template to convert to o
#### Temperature
- DegCToF - input: `float` degrees in C; output `float` degrees in F (1 decimal place).
- DegCToKelvin- input: `float` degrees in C; output `float` Kelvin (1 decimal place).
| Name | Description |
| -------------- | -------------------------------------------------------------------------- |
| `DegCToF` | input: `float` degrees in C; output `float` degrees in F (1 decimal place) |
| `DegCToKelvin` | input: `float` degrees in C; output `float` Kelvin (1 decimal place) |
#### Gravity
- SGToBrix - input `float` SG in x.xxx decimal; output `float` Brix (2 decimal places)
- SGToPlato - input `float` SG in x.xxx decimal; output `float` Plato (2 decimal places)
| Name | Description |
| --------- | -------------------------------------------------------------------------- |
| SGToBrix | input `float` SG in x.xxx decimal; output `float` Brix (2 decimal places) |
| SGToPlato | input `float` SG in x.xxx decimal; output `float` Plato (2 decimal places) |
*(These use the polynomial conversions from [Wikipedia][wikipedia_gravity_page])*
_(These use the polynomial conversions from [Wikipedia][wikipedia_gravity_page])_
#### Example
```` json
```json
{
"template":"{{if .Reading}}{{.SGToBrix .Reading.Gravity}}°Bx, {{.DegCToF .Reading.Temperature}}°F{{end}}"
"template": "{{if .Reading}}{{.SGToBrix .Reading.Gravity}}°Bx, {{.DegCToF .Reading.Temperature}}°F{{end}}"
}
````
```
To display gravity as SG in XXXX format (e.g. "1020" instead of "1.020"), use the `mulf` template function
```` json
```json
{
"template":"{{if .Reading}}{{.mulf 1000 .Reading.Gravity}}, {{.DegCToF .Reading.Temperature}}°F{{end}}"
"template": "{{if .Reading}}{{.mulf 1000 .Reading.Gravity}}, {{.DegCToF .Reading.Temperature}}°F{{end}}"
}
````
```
[templates]: /docs/configuration/templates
[brewfather]: http://brewfather.app
[wikipedia_gravity_page]:https://en.wikipedia.org/wiki/Brix#Specific_gravity_2
[wikipedia_gravity_page]: https://en.wikipedia.org/wiki/Brix#Specific_gravity_2

View file

@ -23,14 +23,12 @@ Display the active [CDS CLI][sap-cap-cds] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the CDS version - defaults to `true`
- missing_command_text: `string` - text to display when the cds command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is displayed when `.cdsrc.json`, `.cdsrc-private` or `*.cds` file is present
- `context`: (default) the segment is displayed when conditions from `files` mode are fulfilled or
`package.json` file is present and `@sap/cds` is in `dependencies` section
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the CDS version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the cds command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is displayed when `.cdsrc.json`, `.cdsrc-private` or `*.cds` file is present</li><li>`context`: the segment is displayed when conditions from `files` mode are fulfilled or `package.json` file is present and `@sap/cds` is in `dependencies` section (**default**)</li></ul> |
## Template ([info][templates])
@ -44,12 +42,14 @@ Display the active [CDS CLI][sap-cap-cds] version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Error`: `string` - error encountered when fetching the version string
- `.HasDependency`: `bool` - a flag if `@sap/cds` was found in `package.json`
| Name | Type | Description |
| ---------------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
| `.HasDependency` | `bool` | a flag if `@sap/cds` was found in `package.json` |
[templates]: /docs/configuration/templates
[sap-cap-cds]: https://cap.cloud.sap/docs/tools/#command-line-interface-cli

View file

@ -23,14 +23,13 @@ Display the active [Cloud Foundry CLI][cloud-foundry] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the Cloud Foundry CLI version - defaults to `true`
- missing_command_text: `string` - text to display when the java command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is displayed when `manifest.yml` or `mta.yaml` file is present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the Cloud Foundry CLI version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the java command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is displayed when `manifest.yml` or `mta.yaml` file is present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
@ -44,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -33,10 +33,12 @@ Display the details of the logged [Cloud Foundry endpoint][cf-target] (`cf targe
### Properties
- `.Org`: `string` - Cloud Foundry organization
- `.Space`: `string` - Cloud Foundry space
- `.URL`: `string` - Cloud Foundry API URL
- `.User`: `string` - logged in user
| Name | Type | Description |
| -------- | -------- | -------------------------- |
| `.Org` | `string` | Cloud Foundry organization |
| `.Space` | `string` | Cloud Foundry space |
| `.URL` | `string` | Cloud Foundry API URL |
| `.User` | `string` | logged in user |
[templates]: /docs/configuration/templates
[cf-target]: https://cli.cloudfoundry.org/en-US/v8/target.html

View file

@ -23,14 +23,13 @@ Display the currently active [Cmake][cmake-github] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the cmake version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.cmake` or `CMakeLists.txt` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the cmake version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.cmake` or `CMakeLists.txt` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
@ -44,12 +43,14 @@ Display the currently active [Cmake][cmake-github] version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[cmake-github]: https://github.com/Kitware/CMake
[go-text-template]: https://golang.org/pkg/text/template/

View file

@ -42,15 +42,17 @@ error). The `&&` functionality will join the output of the commands when success
## Properties
- shell: `string` - the shell in which to run the command in. Uses `shell -c command` under the hood.
- command: `string` - the command(s) to run
- script: `string` - the path to a script to run
| Name | Type | Description |
| --------- | -------- | --------------------------------------------------------------------------------- |
| `shell` | `string` | the shell in which to run the command in. Uses `shell -c command` under the hood. |
| `command` | `string` | the command(s) to run |
| `script` | `string` | the path to a script to run |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Output }}
```
@ -58,7 +60,7 @@ error). The `&&` functionality will join the output of the commands when success
### Properties
- `.Output`: `string` - the output of the command or script.
|`.Output`|`string`|the output of the command or script.|
[env]: /docs/configuration/templates#environment-variables
[templates]: /docs/configuration/templates

View file

@ -23,20 +23,19 @@ Display the currently active crystal version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the julia version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.cr` or `shard.yml` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the julia version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.cr` or `shard.yml` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -44,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,21 +23,19 @@ Display the currently active dart version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the dart version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.dart`, `pubspec.yaml`, `pubspec.yml`, `pubspec.lock` files or the `.dart_tool`
folder are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the dart version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.dart`, `pubspec.yaml`, `pubspec.yml`, `pubspec.lock` files or the `.dart_tool` folder are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -45,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,22 +23,19 @@ Display the currently active [.NET SDK][net-sdk-docs] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the active version or not; useful if all you need is an icon indicating `dotnet`
is present - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.cs`, `*.vb`, `*.fs`, `*.fsx`, `*.sln`, `*.slnf`, `*.csproj`, `*.vbproj`,
or `*.fsproj` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the active version or not; useful if all you need is an icon indicating `dotnet` is present - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.cs`, `*.vb`, `*.fs`, `*.fsx`, `*.sln`, `*.slnf`, `*.csproj`, `*.vbproj`, or `*.fsproj` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Unsupported }}\uf071{{ else }}{{ .Full }}{{ end }}
```
@ -46,14 +43,16 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Prerelease`: `string` - prerelease info text
- `.BuildMetadata`: `string` - build metadata
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| ---------------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Prerelease` | `string` | prerelease info text |
| `.BuildMetadata` | `string` | build metadata |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -31,24 +31,26 @@ The installation guide shows how to include this argument for PowerShell and Zsh
## Properties
- always_enabled: `boolean` - always show the duration - defaults to `false`
- threshold: `number` - minimum duration (milliseconds) required to enable this segment - defaults to `500`
- style: `enum` - one of the available format options - defaults to `austin`
| Name | Type | Description |
| ---------------- | --------- | ----------------------------------------------------------------------------------- |
| `always_enabled` | `boolean` | always show the duration - defaults to `false` |
| `threshold` | `number` | minimum duration (milliseconds) required to enable this segment - defaults to `500` |
| `style` | `enum` | one of the available format options - defaults to `austin` |
## Style
### Style
Style specifies the format in which the time will be displayed. The table below shows some example times in each option.
| format | 0.001s | 2.1s | 3m2.1s | 4h3m2.1s |
| ----------- | -------------- | -------------- | -------------- | ---------------- |
| austin | `1ms` | `2.1s` | `3m 2.1s` | `4h 3m 2.1s` |
| roundrock | `1ms` | `2s 100ms` | `3m 2s 100ms` | `4h 3m 2s 100ms` |
| dallas | `0.001` | `2.1` | `3:2.1` | `4:3:2.1` |
| galveston | `00:00:00` | `00:00:02` | `00:03:02` | `04:03:02` |
| galvestonms | `00:00:00:001` | `00:00:02:100` | `00:03:02:100` | `04:03:02:100` |
| houston | `00:00:00.001` | `00:00:02.1` | `00:03:02.1` | `04:03:02.1` |
| amarillo | `0.001s` | `2.1s` | `182.1s` | `14,582.1s` |
| round | `1ms` | `2s` | `3m 2s` | `4h 3m` |
| format | 0.001s | 2.1s | 3m2.1s | 4h3m2.1s |
| ------------- | -------------- | -------------- | -------------- | ---------------- |
| `austin` | `1ms` | `2.1s` | `3m 2.1s` | `4h 3m 2.1s` |
| `roundrock` | `1ms` | `2s 100ms` | `3m 2s 100ms` | `4h 3m 2s 100ms` |
| `dallas` | `0.001` | `2.1` | `3:2.1` | `4:3:2.1` |
| `galveston` | `00:00:00` | `00:00:02` | `00:03:02` | `04:03:02` |
| `galvestonms` | `00:00:00:001` | `00:00:02:100` | `00:03:02:100` | `04:03:02:100` |
| `houston` | `00:00:00.001` | `00:00:02.1` | `00:03:02.1` | `04:03:02.1` |
| `amarillo` | `0.001s` | `2.1s` | `182.1s` | `14,582.1s` |
| `round` | `1ms` | `2s` | `3m 2s` | `4h 3m` |
## Template ([info][templates])
@ -62,7 +64,9 @@ Style specifies the format in which the time will be displayed. The table below
### Properties
- `.Ms`: `number` - the execution time in milliseconds
- `.FormattedMs`: `string` - the formatted value based on the `style` above.
| Name | Type | Description |
| -------------- | -------- | ---------------------------------------------- |
| `.Ms` | `number` | the execution time in milliseconds |
| `.FormattedMs` | `string` | the formatted value based on the `style` above |
[templates]: /docs/configuration/templates

View file

@ -16,10 +16,7 @@ Displays the last exit code or that the last command failed based on the configu
"style": "diamond",
"foreground": "#ffffff",
"background": "#00897b",
"background_templates": [
"{{ if gt .Code 0 }}#e91e63{{ end }}",
],
"leading_diamond": "",
"background_templates": ["{{ if gt .Code 0 }}#e91e63{{ end }}"],
"trailing_diamond": "\uE0B4",
"template": "<#193549>\uE0B0</> \uE23A ",
"properties": {
@ -30,7 +27,9 @@ Displays the last exit code or that the last command failed based on the configu
## Properties
- always_enabled: `boolean` - always show the status - defaults to `false`
| Name | Type | Description |
| ---------------- | --------- | -------------------------------------------- |
| `always_enabled` | `boolean` | always show the status - defaults to `false` |
[colors]: /docs/configuration/colors
@ -38,7 +37,7 @@ Displays the last exit code or that the last command failed based on the configu
:::note default template
``` template
```template
{{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }}
```
@ -46,7 +45,9 @@ Displays the last exit code or that the last command failed based on the configu
### Properties
- `.Code`: `number` - the last known exit code
- `.Meaning`: `string` - the textual meaning linked to exit code (if applicable, otherwise identical to `.Code`)
| Name | Type | Description |
| ---------- | -------- | --------------------------------------------------------------------------------------- |
| `.Code` | `number` | the last known exit code |
| `.Meaning` | `string` | the textual meaning linked to exit code (if applicable, otherwise identical to `.Code`) |
[templates]: /docs/configuration/templates

View file

@ -23,21 +23,19 @@ Display the currently active flutter version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the flutter version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.dart`, `pubspec.yaml`, `pubspec.yml`, `pubspec.lock` files or the `.dart_tool`
folder are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the flutter version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.dart`, `pubspec.yaml`, `pubspec.yml`, `pubspec.lock` files or the `.dart_tool` folder are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -45,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -8,14 +8,6 @@ sidebar_label: Fossil
Display [fossil][fossil] information when in a fossil repository.
Local changes can also be displayed which uses the following syntax:
- `+` added
- `!` conflicted
- `-` deleted
- `~` modified
- `>` moved
## Sample Configuration
```json
@ -30,14 +22,15 @@ Local changes can also be displayed which uses the following syntax:
## Properties
- native_fallback: `boolean` - when set to `true` and `fossil.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native fossil
executable to fetch data. Not all information can be displayed in this case. Defaults to `false`.
| Name | Type | Description |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `native_fallback` | `boolean` | when set to `true` and `fossil.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native fossil executable to fetch data. Not all information can be displayed in this case. Defaults to `false` |
## Template ([info][templates])
:::note default template
``` template
```template
\ufb2b {{.Branch}} {{.Status.String}}
```
@ -45,19 +38,33 @@ executable to fetch data. Not all information can be displayed in this case. Def
### Properties
- `.Status`: `FossilStatus` - changes in the worktree (see below)
- `.Branch`: `string` - current branch
| Name | Type | Description |
| --------- | -------------- | ----------------------------------- |
| `.Status` | `FossilStatus` | changes in the worktree (see below) |
| `.Branch` | `string` | current branch |
### FossilStatus
- `.Modified`: `int` - number of edited, updated and changed files
- `.Deleted`: `int` - number of deleted files
- `.Added`: `int` - number of added files
- `.Moved`: `int` - number of renamed files
- `.Conflicted`: `int` - number of conflicting files
- `.Changed`: `boolean` - if the status contains changes or not
- `.HasConflicts`: `boolean` - if the status contains conflicts or not
- `.String`: `string` - a string representation of the changes above
| Name | Type | Description |
| --------------- | --------- | -------------------------------------------- |
| `.Modified` | `int` | number of edited, updated and changed files |
| `.Deleted` | `int` | number of deleted files |
| `.Added` | `int` | number of added files |
| `.Moved` | `int` | number of renamed files |
| `.Conflicted` | `int` | number of conflicting files |
| `.Changed` | `boolean` | if the status contains changes or not |
| `.HasConflicts` | `boolean` | if the status contains conflicts or not |
| `.String` | `string` | a string representation of the changes above |
Local changes use the following syntax:
| Icon | Description |
| ---- | ----------- |
| `+` | added |
| `!` | conflicted |
| `-` | deleted |
| `~` | modified |
| `>` | moved |
[fossil]: https://fossil-scm.org
[templates]: /docs/config-templates

View file

@ -25,7 +25,7 @@ Display the currently active GCP project, region and account
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Project }}{{ end }}
```
@ -33,9 +33,11 @@ Display the currently active GCP project, region and account
### Properties
- `.Project`: `string` - the currently active project
- `.Account`: `string` - the currently active account
- `.Region`: `string` - default region for the active context
- `.Error`: `string` - contains any error messages generated when trying to load the GCP config
| Name | Type | Description |
| ---------- | -------- | ------------------------------------------------------------------------ |
| `.Project` | `string` | the currently active project |
| `.Account` | `string` | the currently active account |
| `.Region` | `string` | default region for the active context |
| `.Error` | `string` | contains any error messages generated when trying to load the GCP config |
[templates]: /docs/configuration/templates

View file

@ -9,13 +9,6 @@ sidebar_label: Git
Display git information when in a git repository. Also works for subfolders. For maximum compatibility,
make sure your `git` executable is up-to-date (when branch or status information is incorrect for example).
Local changes can also be displayed which uses the following syntax for both the working and staging area:
- `+` added
- `~` modified
- `-` deleted
- `?` untracked
:::tip
PowerShell offers support for the [posh-git][poshgit] module for autocompletion, but it is disabled by default.
To enable this, set `$env:POSH_GIT_ENABLED = $true` in your `$PROFILE`. This will also make use of the
@ -56,54 +49,57 @@ To enable this, set `$env:POSH_GIT_ENABLED = $true` in your `$PROFILE`. This wil
As doing multiple git calls can slow down the prompt experience, we do not fetch information by default.
You can set the following properties to `true` to enable fetching additional information (and populate the template).
- fetch_status: `boolean` - fetch the local changes - defaults to `false`
- fetch_stash_count: `boolean` fetch stash count - defaults to `false`
- fetch_worktree_count: `boolean` fetch worktree count - defaults to `false`
- fetch_upstream_icon: `boolean` - fetch upstream icon - defaults to `false`
- untracked_modes: `map[string]string` - map of repo's where to override the default [untracked files mode][untracked] (`no` | `normal` | `all`). For example
`"untracked_modes": { "/Users/me/repos/repo1": "no" }` - defaults to `normal` for all repo's. If you want to override for all repo's, use
`*` to set the mode instead of the repo path.
- ignore_submodules: `map[string]string` - map of repo's where to change the [--ignore-submodules][submodules] flag (`none`, `untracked`, `dirty` or `all`).
For example `"ignore_submodules": { "/Users/me/repos/repo1": "all" }`. If you want to override for all repo's, use `*` to set the mode
instead of the repo path.
- native_fallback: `boolean` - when set to `true` and `git.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native git
executable to fetch data. Not all information can be displayed in this case. Defaults to `false`.
| Name | Type | Description |
| ---------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fetch_status` | `boolean` | fetch the local changes - defaults to `false` |
| `fetch_stash_count` | `boolean` | fetch stash count - defaults to `false` |
| `fetch_worktree_count` | `boolean` | fetch worktree count - defaults to `false` |
| `fetch_upstream_icon` | `boolean` | fetch upstream icon - defaults to `false` |
| `untracked_modes` | `map[string]string` | map of repo's where to override the default [untracked files mode][untracked]:<ul><li>`no`</li><li>`normal`</li><li>`all`</li></ul>For example `"untracked_modes": { "/Users/me/repos/repo1": "no" }` - defaults to `normal` for all repo's. If you want to override for all repo's, use `*` to set the mode instead of the repo path |
| `ignore_submodules` | `map[string]string` | map of repo's where to change the [--ignore-submodules][submodules] flag (`none`, `untracked`, `dirty` or `all`). For example `"ignore_submodules": { "/Users/me/repos/repo1": "all" }`. If you want to override for all repo's, use `*` to set the mode instead of the repo path |
| `native_fallback` | `boolean` | when set to `true` and `git.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native git executable to fetch data. Not all information can be displayed in this case. Defaults to `false` |
### Icons
#### Branch
- branch_icon: `string` - the icon to use in front of the git branch name - defaults to `\uE0A0 `
- branch_identical_icon: `string` - the icon to display when remote and local are identical - defaults to `\u2261`
- branch_ahead_icon: `string` - the icon to display when the local branch is ahead of its remote - defaults to `\u2191`
- branch_behind_icon: `string` - the icon to display when the local branch is behind its remote - defaults to `\u2193`
- branch_gone_icon: `string` - the icon to display when there's no remote branch - defaults to `\u2262`
- branch_max_length: `int` - the max length for the displayed branch name where `0` implies full length - defaults to `0`
- truncate_symbol: `string` - the icon to display when a branch name is truncated - defaults to empty
| Name | Type | Description |
| ----------------------- | -------- | -------------------------------------------------------------------------------------------- |
| `branch_icon` | `string` | the icon to use in front of the git branch name - defaults to `\uE0A0 ` |
| `branch_identical_icon` | `string` | the icon to display when remote and local are identical - defaults to `\u2261` |
| `branch_ahead_icon` | `string` | the icon to display when the local branch is ahead of its remote - defaults to `\u2191` |
| `branch_behind_icon` | `string` | the icon to display when the local branch is behind its remote - defaults to `\u2193` |
| `branch_gone_icon` | `string` | the icon to display when there's no remote branch - defaults to `\u2262` |
| `branch_max_length` | `int` | the max length for the displayed branch name where `0` implies full length - defaults to `0` |
| `truncate_symbol` | `string` | the icon to display when a branch name is truncated - defaults to empty |
#### HEAD
- commit_icon: `string` - icon/text to display before the commit context (detached HEAD) - defaults to `\uF417`
- tag_icon: `string` - icon/text to display before the tag context - defaults to `\uF412`
- rebase_icon: `string` - icon/text to display before the context when in a rebase - defaults to `\uE728 `
- cherry_pick_icon: `string` - icon/text to display before the context when doing a cherry-pick - defaults to `\uE29B `
- revert_icon: `string` - icon/text to display before the context when doing a revert - defaults to `\uF0E2 `
- merge_icon: `string` icon/text to display before the merge context - defaults to `\uE727 `
- no_commits_icon: `string` icon/text to display when there are no commits in the repo - defaults to `\uF594 `
| Name | Type | Description |
| ------------------ | -------- | ---------------------------------------------------------------------------------------- |
| `commit_icon` | `string` | icon/text to display before the commit context (detached HEAD) - defaults to `\uF417` |
| `tag_icon` | `string` | icon/text to display before the tag context - defaults to `\uF412` |
| `rebase_icon` | `string` | icon/text to display before the context when in a rebase - defaults to `\uE728 ` |
| `cherry_pick_icon` | `string` | icon/text to display before the context when doing a cherry-pick - defaults to `\uE29B ` |
| `revert_icon` | `string` | icon/text to display before the context when doing a revert - defaults to `\uF0E2 ` |
| `merge_icon` | `string` | icon/text to display before the merge context - defaults to `\uE727 ` |
| `no_commits_icon` | `string` | icon/text to display when there are no commits in the repo - defaults to `\uF594 ` |
#### Upstream
- github_icon: `string` - icon/text to display when the upstream is Github - defaults to `\uF408 `
- gitlab_icon: `string` - icon/text to display when the upstream is Gitlab - defaults to `\uF296 `
- bitbucket_icon: `string` - icon/text to display when the upstream is Bitbucket - defaults to `\uF171 `
- azure_devops_icon: `string` - icon/text to display when the upstream is Azure DevOps - defaults to `\uFD03 `
- git_icon: `string` - icon/text to display when the upstream is not known/mapped - defaults to `\uE5FB `
| Name | Type | Description |
| ------------------- | -------- | ---------------------------------------------------------------------------------- |
| `github_icon` | `string` | icon/text to display when the upstream is Github - defaults to `\uF408 ` |
| `gitlab_icon` | `string` | icon/text to display when the upstream is Gitlab - defaults to `\uF296 ` |
| `bitbucket_icon` | `string` | icon/text to display when the upstream is Bitbucket - defaults to `\uF171 ` |
| `azure_devops_icon` | `string` | icon/text to display when the upstream is Azure DevOps - defaults to `\uFD03 ` |
| `git_icon` | `string` | icon/text to display when the upstream is not known/mapped - defaults to `\uE5FB ` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0}} \uF692 {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }}
```
@ -111,32 +107,45 @@ executable to fetch data. Not all information can be displayed in this case. Def
### Properties
- `.RepoName`: `string` - the repo folder name
- `.Working`: `GitStatus` - changes in the worktree (see below)
- `.Staging`: `GitStatus` - staged changes in the work tree (see below)
- `.HEAD`: `string` - the current HEAD context (branch/rebase/merge/...)
- `.Ref`: `string` - the current HEAD reference (branch/tag/...)
- `.Behind`: `int` - commits behind of upstream
- `.Ahead`: `int` - commits ahead of upstream
- `.BranchStatus`: `string` - the current branch context (ahead/behind string representation)
- `.Upstream`: `string` - the upstream name (remote)
- `.UpstreamGone`: `boolean` - whether the upstream is gone (no remote)
- `.UpstreamIcon`: `string` - the upstream icon (based on the icons above)
- `.UpstreamURL`: `string` - the upstream URL for use in [hyperlinks][hyperlinks] in templates: `{{ url .UpstreamIcon .UpstreamURL }}`
- `.StashCount`: `int` - the stash count
- `.WorktreeCount`: `int` - the worktree count
- `.IsWorkTree`: `boolean` - if in a worktree repo or not
- `.Dir`: `string` - the repository's root directory
- `.Kraken`: `string` - a link to the current HEAD in [GitKraken][kraken-ref] for use in [hyperlinks][hyperlinks] in templates `{{ url .HEAD .Kraken }}`
| Name | Type | Description |
| ---------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `.RepoName` | `string` | the repo folder name |
| `.Working` | `GitStatus` | changes in the worktree (see below) |
| `.Staging` | `GitStatus` | staged changes in the work tree (see below) |
| `.HEAD` | `string` | the current HEAD context (branch/rebase/merge/...) |
| `.Ref` | `string` | the current HEAD reference (branch/tag/...) |
| `.Behind` | `int` | commits behind of upstream |
| `.Ahead` | `int` | commits ahead of upstream |
| `.BranchStatus` | `string` | the current branch context (ahead/behind string representation) |
| `.Upstream` | `string` | the upstream name (remote) |
| `.UpstreamGone` | `boolean` | whether the upstream is gone (no remote) |
| `.UpstreamIcon` | `string` | the upstream icon (based on the icons above) |
| `.UpstreamURL` | `string` | the upstream URL for use in [hyperlinks][hyperlinks] in templates: `{{ url .UpstreamIcon .UpstreamURL }}` |
| `.StashCount` | `int` | the stash count |
| `.WorktreeCount` | `int` | the worktree count |
| `.IsWorkTree` | `boolean` | if in a worktree repo or not |
| `.Dir` | `string` | the repository's root directory |
| `.Kraken` | `string` | a link to the current HEAD in [GitKraken][kraken-ref] for use in [hyperlinks][hyperlinks] in templates `{{ url .HEAD .Kraken }}` |
### GitStatus
- `.Unmerged`: `int` - number of unmerged changes
- `.Deleted`: `int` - number of deleted changes
- `.Added`: `int` - number of added changes
- `.Modified`: `int` - number of modified changes
- `.Changed`: `boolean` - if the status contains changes or not
- `.String`: `string` - a string representation of the changes above
| Name | Type | Description |
| ----------- | --------- | -------------------------------------------- |
| `.Unmerged` | `int` | number of unmerged changes |
| `.Deleted` | `int` | number of deleted changes |
| `.Added` | `int` | number of added changes |
| `.Modified` | `int` | number of modified changes |
| `.Changed` | `boolean` | if the status contains changes or not |
| `.String` | `string` | a string representation of the changes above |
Local changes use the following syntax:
| Icon | Description |
| ---- | ----------- |
| `+` | added |
| `~` | modified |
| `-` | deleted |
| `?` | untracked |
[poshgit]: /docs/segments/poshgit
[templates]: /docs/configuration/templates

View file

@ -23,21 +23,20 @@ Display the currently active golang version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the golang version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.go` or `go.mod` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
- parse_mod_file: `boolean`: parse the go.mod file instead of calling `go version`
| Name | Type | Description |
| ---------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the golang version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.go` or `go.mod` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `parse_mod_file` | `boolean`: parse the go.mod file instead of calling `go version` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -45,12 +44,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,20 +23,14 @@ Display the currently active Glasgow Haskell Compiler (GHC) version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the GHC version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.hs`, `*.lhs`, `stack.yaml`, `package.yaml`, `*.cabal`,
or `cabal.project` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
- stack_ghc_mode: `string` - determines when to use stack ghc to retrieve the version information.
Using stack ghc will decrease performance.
- `never`: never use stack ghc (default)
- `package`: only use stack ghc when `stack.yaml` is in the root of the package
- `always`: always use stack ghc
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the GHC version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.hs`, `*.lhs`, `stack.yaml`, `package.yaml`, `*.cabal`, or `cabal.project` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `stack_ghc_mode` | `string` | determines when to use `stack ghc` to retrieve the version information. Using `stack ghc` will decrease performance.<ul><li>`never`: never use `stack ghc` (**default**)</li><li>`package`: only use `stack ghc` when `stack.yaml` is in the root of the </li><li>`always`: always use `stack ghc`</li></ul> |
## Template ([info][templates])
@ -50,13 +44,15 @@ Using stack ghc will decrease performance.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
- `.StackGhc`: `boolean` - `true` if stack ghc was used, otherwise `false`
| Name | Type | Description |
| ----------- | --------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
| `.StackGhc` | `boolean` | `true` if `stack ghc` was used, otherwise `false` |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -16,7 +16,7 @@ sidebar_label: Ipify
"style": "diamond",
"foreground": "#ffffff",
"background": "#c386f1",
"leading_diamond": "",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\uE0B0",
"template": "{{ .IP }}",
"properties": {
@ -28,17 +28,17 @@ sidebar_label: Ipify
## Properties
- url: `string` - The Ipify URL, by default IPv4 is used, use `https://api64.ipify.org` for IPv6 - defaults to `https://api.ipify.org`
- http_timeout: `int` - How long may the segment wait for a response of the ipify API? -
defaults to 20ms
- cache_timeout: `int` in minutes - How long do you want your IP address cached? -
defaults to 10 min
| Name | Type | Description |
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `url` | `string` | The Ipify URL, by default IPv4 is used, use `https://api64.ipify.org` for IPv6 - defaults to `https://api.ipify.org` |
| `http_timeout` | `int` | How long may the segment wait for a response of the ipify API? - defaults to 20ms |
| `cache_timeout` | `int` | in minutes - How long you want your IP address cached - defaults to 10 min |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .IP }}
```
@ -46,7 +46,9 @@ sidebar_label: Ipify
### Properties
- .IP: `string` - Your external IP address
| Name | Type | Description |
| ---- | -------- | ------------------------ |
| .IP | `string` | Your external IP address |
[templates]: /docs/configuration/templates
[ipify]: https://www.ipify.org/

View file

@ -23,31 +23,18 @@ Display the currently active java version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the java version - defaults to `true`
- missing_command_text: `string` - text to display when the java command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when one of the following files is present:
- `pom.xml`
- `build.gradle.kts`
- `build.sbt`
- `.java-version`
- `.deps.edn`
- `project.clj`
- `build.boot`
- `*.java`
- `*.class`
- `*.gradle`
- `*.jar`
- `*.clj`
- `*.cljc`
| Name | Type | Description |
| ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the java version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the java command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when one of the following files is present<ul><li>`pom.xml`</li><li>`build.gradle.kts`</li><li>`build.sbt`</li><li>`.java-version`</li><li>`.deps.edn`</li><li>`project.clj`</li><li>`build.boot`</li><li>`*.java`</li><li>`*.class`</li><li>`*.gradle`</li><li>`*.jar`</li><li>`*.clj`</li><li>`*.cljc`</li></ul></li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -55,10 +42,12 @@ Display the currently active java version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
[templates]: /docs/configuration/templates

View file

@ -23,20 +23,19 @@ Display the currently active julia version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the julia version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.jl` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the julia version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.jl` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -44,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,20 +23,19 @@ Display the currently active [Kotlin][kotlin] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the kotlin version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.kt`, `*.kts` and `*.ktm` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the kotlin version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.kt`, `*.kts` or `*.ktm` files are present (**default**) </li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -44,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,15 +23,16 @@ Display the currently active Kubernetes context name and namespace name.
## Properties
- display_error: `boolean` - show the error context when failing to retrieve the kubectl information - defaults to `false`
- parse_kubeconfig: `boolean` - parse kubeconfig files instead of calling out to kubectl to improve
performance - defaults to `false`
| Name | Type | Description |
| ------------------ | --------- | ----------------------------------------------------------------------------------------------------- |
| `display_error` | `boolean` | show the error context when failing to retrieve the kubectl information - defaults to `false` |
| `parse_kubeconfig` | `boolean` | parse kubeconfig files instead of calling out to kubectl to improve performance - defaults to `false` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Context }}{{ if .Namespace }} :: {{ .Namespace }}{{ end }}
```
@ -39,15 +40,17 @@ performance - defaults to `false`
### Properties
- `.Context`: `string` - the current kubectl context
- `.Namespace`: `string` - the current kubectl context namespace
- `.User`: `string` - the current kubectl context user
- `.Cluster`: `string` - the current kubectl context cluster
| Name | Type | Description |
| ------------ | -------- | ------------------------------------- |
| `.Context` | `string` | the current kubectl context |
| `.Namespace` | `string` | the current kubectl context namespace |
| `.User` | `string` | the current kubectl context user |
| `.Cluster` | `string` | the current kubectl context cluster |
## Tips
It is common for the Kubernetes "default" namespace to be used when no namespace is provided. If you want your prompt to
render an empty current namespace using the word "default", you can use something like this for the template:
render an empty current namespace using the word "default", you can use something like this for the template:
`{{.Context}} :: {{if .Namespace}}{{.Namespace}}{{else}}default{{end}}`

View file

@ -23,23 +23,20 @@ Display the currently active [Lua][lua] or [LuaJIT][luajit] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the lua version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.lua`, `*.rockspec` files or the `lua` folder are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
- preferred_executable: `string` - the preferred executable to use when fetching the version
- `lua`: the Lua executable (default)
- `luajit`: the LuaJIT executable
| Name | Type | Description |
| ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the lua version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.lua`, `*.rockspec` files or the `lua` folder are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `preferred_executable` | `string` | the preferred executable to use when fetching the version<ul><li>`lua`: the Lua executable (**default**)</li><li>`luajit`: the LuaJIT executable</li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -47,13 +44,15 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
- `.Executable`: `string` - the executable used to fetch the version
| Name | Type | Description |
| ------------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
| `.Executable` | `string` | the executable used to fetch the version |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -29,7 +29,7 @@ The Nerdbank.GitVersioning CLI can be a bit slow causing the prompt to feel slow
:::note default template
``` template
```template
{{ .Version }}
```
@ -37,13 +37,15 @@ The Nerdbank.GitVersioning CLI can be a bit slow causing the prompt to feel slow
### Properties
- `.Version`: `string` - the current version
- `.AssemblyVersion`: `string` - the current assembly version
- `.AssemblyInformationalVersion`: `string` - the current assembly informational version
- `.NuGetPackageVersion`: `string` - the current nuget package version
- `.ChocolateyPackageVersion`: `string` - the current chocolatey package version
- `.NpmPackageVersion`: `string` - the current npm package version
- `.SimpleVersion`: `string` - the current simple version
| Name | Type | Description |
| ------------------------------- | -------- | ------------------------------------------ |
| `.Version` | `string` | the current version |
| `.AssemblyVersion` | `string` | the current assembly version |
| `.AssemblyInformationalVersion` | `string` | the current assembly informational version |
| `.NuGetPackageVersion` | `string` | the current nuget package version |
| `.ChocolateyPackageVersion` | `string` | the current chocolatey package version |
| `.NpmPackageVersion` | `string` | the current npm package version |
| `.SimpleVersion` | `string` | the current simple version |
[nbgv]: https://github.com/dotnet/Nerdbank.GitVersioning
[templates]: /docs/configuration/templates

View file

@ -40,7 +40,7 @@ if that color is visible against any of your backgrounds.
"#000000"
],
"leading_diamond": "",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\uE0B0",
"template": "\ue2a1 {{ .Sgv }}{{ .TrendIcon }}",
"properties": {
@ -58,32 +58,33 @@ Or display in mmol/l (instead of the default mg/dl) with the following template:
## Properties
- url: `string` - Your Nightscout URL, including the full path to entries.json
AND count=1 AND token. Example above. You'll know this works if you can curl
it yourself and get a single value. - defaults to ``
- http_timeout: `int` - How long do you want to wait before you want to see
your prompt more than your sugar? I figure a half second is a good default -
defaults to 500ms
- NSCacheTimeout: `int` in minutes - How long do you want your numbers cached? -
defaults to 5 min
| Name | Type | Description |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `url` | `string` | Your Nightscout URL, including the full path to entries.json AND count=1 AND token. Example above. You'll know this works if you can curl it yourself and get a single value. - defaults to `` |
| `http_timeout` | `int` | How long do you want to wait before you want to see your prompt more than your sugar? I figure a half second is a good default - defaults to 500ms |
| `cache_timeout` | `int` | in minutes - How long do you want your numbers cached? - defaults to 5 min |
- NOTE: You can change the icons for trend, put the trend elsewhere, add text,
however you like!
Make sure your NerdFont has the glyph you want or search for one at
nerdfonts.com
- DoubleUpIcon - defaults to ↑↑
- SingleUpIcon - defaults to ↑
- FortyFiveUpIcon - defaults to ↗
- FlatIcon - defaults to →
- FortyFiveDownIcon - defaults to ↘
- SingleDownIcon - defaults to ↓
- DoubleDownIcon - defaults to ↓↓
:::info
You can change the icons for trend, put the trend elsewhere, add text, however you like!
Make sure your NerdFont has the glyph you want or [search for one][nf-search].
| Icon | Description |
| ------------------- | ---------------- |
| `DoubleUpIcon` | defaults to `↑↑` |
| `SingleUpIcon` | defaults to `↑` |
| `FortyFiveUpIcon` | defaults to `↗` |
| `FlatIcon` | defaults to `→` |
| `FortyFiveDownIcon` | defaults to `↘` |
| `SingleDownIcon` | defaults to `↓` |
| `DoubleDownIcon` | defaults to `↓↓` |
:::
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Sgv }}
```
@ -91,18 +92,20 @@ Or display in mmol/l (instead of the default mg/dl) with the following template:
### Properties
- .ID: `string` - The internal ID of the object
- .Sgv: `int` - Your Serum Glucose Value (your sugar)
- .Date: `int` - The unix timestamp of the entry
- .DateString: `time` - The timestamp of the entry
- .Trend: `int` - The trend of the entry
- .Device: `string` - The device linked to the entry
- .Type: `string` - The type of the entry
- .UtcOffset: `int` - The UTC offset
- .SysTime: `time` - The time on the system
- .Mills: `int` - The amount of mills
- .TrendIcon: `string` - By default, this will be something like ↑↑ or ↘ etc but you can
override them with any glpyh as seen above
| Name | Type | Description |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| .ID | `string` | The internal ID of the object |
| .Sgv | `int` | Your Serum Glucose Value (your sugar) |
| .Date | `int` | The unix timestamp of the entry |
| .DateString | `time` | The timestamp of the entry |
| .Trend | `int` | The trend of the entry |
| .Device | `string` | The device linked to the entry |
| .Type | `string` | The type of the entry |
| .UtcOffset | `int` | The UTC offset |
| .SysTime | `time` | The time on the system |
| .Mills | `int` | The amount of mills |
| .TrendIcon | `string` | By default, this will be something like ↑↑ or ↘ etc but you can override them with any glpyh as seen above |
[templates]: /docs/configuration/templates
[nightscout]: http://www.nightscout.info/
[nf-search]: https://www.nerdfonts.com/cheat-sheet

View file

@ -23,24 +23,22 @@ Display the currently active [Node.js][node-js] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the Node.js version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: The segment is always displayed
- `files`: The segment is only displayed when `*.js`, `*.ts`, `package.json`, `.nvmrc`, `pnpm-workspace.yaml`,
`.pnpmfile.cjs`, `.npmrc` or `.vue` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
- fetch_package_manager: `boolean` - define if the current project uses Yarn or NPM - defaults to `false`
- yarn_icon: `string` - the icon/text to display when using Yarn - defaults to ` \uF61A`
- npm_icon: `string` - the icon/text to display when using NPM - defaults to ` \uE71E`
| Name | Type | Description |
| ----------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the Node.js version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: The segment is always displayed</li><li>`files`: The segment is only displayed when one of the following files is present (**default**):<ul><li>`*.js`</li><li>`*.ts`</li><li>`package.json`</li><li>`.nvmrc`</li><li>`pnpm-workspace.yaml`</li><li>`.pnpmfile.cjs`</li><li>`.npmrc`</li><li>`.vue`</li></ul></li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `fetch_package_manager` | `boolean` | define if the current project uses Yarn or NPM - defaults to `false` |
| `yarn_icon` | `string` | the icon/text to display when using Yarn - defaults to ` \uF61A` |
| `npm_icon` | `string` | the icon/text to display when using NPM - defaults to ` \uE71E` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}
```
@ -48,14 +46,16 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
- `.PackageManagerIcon`: `string` - the Yarn or NPM icon when setting `fetch_package_manager` to `true`
- `.Mismatch`: `boolean` - if the version in `.nvmrc` matches with `.Full`
| Name | Type | Description |
| --------------------- | --------- | ------------------------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
| `.PackageManagerIcon` | `string` | the Yarn or NPM icon when setting `fetch_package_manager` to `true` |
| `.Mismatch` | `boolean` | if the version in `.nvmrc` matches with `.Full` |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,20 +23,19 @@ Display the currently active [npm][npm-docs] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- fetch_version: `boolean` - fetch the NPM version - defaults to `true`
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `package.json` or `package-lock.json` file are present
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `fetch_version` | `boolean` | fetch the NPM version - defaults to `true` |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `package.json` or `package-lock.json` file are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
\ue71e {{.Full}}
```
@ -44,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,13 +23,12 @@ Display the currently active [Nx][nx-docs] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - fetch the active version or not; useful if all you need is an icon indicating `ng`
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when a `workspace.json` or `nx.json` file is present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | fetch the active version or not; useful if all you need is an icon indicating `ng` |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when a `workspace.json` or `nx.json` file is present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
@ -43,12 +42,14 @@ Display the currently active [Nx][nx-docs] version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -25,35 +25,37 @@ Display OS specific info - defaults to Icon.
## Properties
- macos: `string` - the string to use for macOS - defaults to macOS icon - defaults to `\uF179`
- linux: `string` - the icon to use for Linux - defaults to Linux icon - defaults to `\uF17C`
- windows: `string` - the icon to use for Windows - defaults to Windows icon - defaults to `\uE62A`
- display_distro_name: `boolean` - display the distro name or icon (for WSL and Linux) - defaults to `false`
- alpine: `string` - the icon to use for Alpine - defaults to Alpine icon - defaults to `\uF300`
- aosc: `string` - the icon to use for Aosc - defaults to Aosc icon - defaults to `\uF301`
- arch: `string` - the icon to use for Arch - defaults to Arch icon - defaults to `\uF303`
- centos: `string` - the icon to use for Centos - defaults to Centos icon - defaults to `\uF304`
- coreos: `string` - the icon to use for Coreos - defaults to Coreos icon - defaults to `\uF305`
- debian: `string` - the icon to use for Debian - defaults to Debian icon - defaults to `\uF306`
- devuan: `string` - the icon to use for Devuan - defaults to Devuan icon - defaults to `\uF307`
- raspbian: `string` - the icon to use for Raspbian - defaults to Raspbian icon - defaults to `\uF315`
- elementary: `string` - the icon to use for Elementary - defaults to Elementary icon - defaults to `\uF309`
- fedora: `string` - the icon to use for Fedora - defaults to Fedora icon - defaults to `\uF30a`
- gentoo: `string` - the icon to use for Gentoo - defaults to Gentoo icon - defaults to `\uF30d`
- mageia: `string` - the icon to use for Mageia - defaults to Mageia icon - defaults to `\uF310`
- manjaro: `string` - the icon to use for Manjaro - defaults to Manjaro icon - defaults to `\uF312`
- mint: `string` - the icon to use for Mint - defaults to Mint icon - defaults to `\uF30e`
- nixos: `string` - the icon to use for Nixos - defaults to Nixos icon - defaults to `\uF313`
- opensuse: `string` - the icon to use for Opensuse - defaults to Opensuse icon - defaults to `\uF314`
- sabayon: `string` - the icon to use for Sabayon - defaults to Sabayon icon - defaults to `\uF317`
- slackware: `string` - the icon to use for Slackware - defaults to Slackware icon - defaults to `\uF319`
- ubuntu: `string` - the icon to use for Ubuntu - defaults to Ubuntu icon - defaults to `\uF31b`
| Name | Type | Description |
| --------------------- | --------- | ----------------------------------------------------------------------------------- |
| `macos` | `string` | the string to use for macOS - defaults to macOS icon - defaults to `\uF179` |
| `linux` | `string` | the icon to use for Linux - defaults to Linux icon - defaults to `\uF17C` |
| `windows` | `string` | the icon to use for Windows - defaults to Windows icon - defaults to `\uE62A` |
| `display_distro_name` | `boolean` | display the distro name or icon (for WSL and Linux) - defaults to `false` |
| `alpine` | `string` | the icon to use for Alpine - defaults to Alpine icon - defaults to `\uF300` |
| `aosc` | `string` | the icon to use for Aosc - defaults to Aosc icon - defaults to `\uF301` |
| `arch` | `string` | the icon to use for Arch - defaults to Arch icon - defaults to `\uF303` |
| `centos` | `string` | the icon to use for Centos - defaults to Centos icon - defaults to `\uF304` |
| `coreos` | `string` | the icon to use for Coreos - defaults to Coreos icon - defaults to `\uF305` |
| `debian` | `string` | the icon to use for Debian - defaults to Debian icon - defaults to `\uF306` |
| `devuan` | `string` | the icon to use for Devuan - defaults to Devuan icon - defaults to `\uF307` |
| `raspbian` | `string` | the icon to use for Raspbian - defaults to Raspbian icon - defaults to `\uF315` |
| `elementary` | `string` | the icon to use for Elementary - defaults to Elementary icon - defaults to `\uF309` |
| `fedora` | `string` | the icon to use for Fedora - defaults to Fedora icon - defaults to `\uF30a` |
| `gentoo` | `string` | the icon to use for Gentoo - defaults to Gentoo icon - defaults to `\uF30d` |
| `mageia` | `string` | the icon to use for Mageia - defaults to Mageia icon - defaults to `\uF310` |
| `manjaro` | `string` | the icon to use for Manjaro - defaults to Manjaro icon - defaults to `\uF312` |
| `mint` | `string` | the icon to use for Mint - defaults to Mint icon - defaults to `\uF30e` |
| `nixos` | `string` | the icon to use for Nixos - defaults to Nixos icon - defaults to `\uF313` |
| `opensuse` | `string` | the icon to use for Opensuse - defaults to Opensuse icon - defaults to `\uF314` |
| `sabayon` | `string` | the icon to use for Sabayon - defaults to Sabayon icon - defaults to `\uF317` |
| `slackware` | `string` | the icon to use for Slackware - defaults to Slackware icon - defaults to `\uF319` |
| `ubuntu` | `string` | the icon to use for Ubuntu - defaults to Ubuntu icon - defaults to `\uF31b` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .WSL }}WSL at {{ end }}{{.Icon}}
```
@ -61,6 +63,8 @@ Display OS specific info - defaults to Icon.
### Properties
- `.Icon`: `string` - the OS icon
| Name | Type | Description |
| ------- | -------- | ----------- |
| `.Icon` | `string` | the OS icon |
[templates]: /docs/configuration/templates

View file

@ -10,7 +10,7 @@ Shows the current weather of a given location with [Open Weather Map][owm].
:::caution
You **must** request an API key at the [Open Weather Map][owm-price] website.
The free tier for *Current weather and forecasts collection* is sufficient.
The free tier for _Current weather and forecasts collection_ is sufficient.
:::
## Sample Configuration
@ -35,22 +35,20 @@ The free tier for *Current weather and forecasts collection* is sufficient.
## Properties
- apikey: `string` - Your API key from [Open Weather Map][owm]
- location: `string` - The requested location.
Formatted as <City,STATE,COUNTRY_CODE>. City name, state code and country code divided by comma.
Please, refer to ISO 3166 for the state codes or country codes - defaults to `DE BILT,NL`
- units: `string` - Units of measurement.
Available values are standard (kelvin), metric (celsius), and imperial (fahrenheit) - defaults to `standard`
- http_timeout: `int` - The default timeout for http request is 20ms.
- cache_timeout: `int` - The default timeout for request caching is 10m. A value of 0 disables the cache.
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
properties below - defaults to `{{.Weather}} ({{.Temperature}}{{.UnitIcon}})`
| Name | Type | Description |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `apikey` | `string` | Your API key from [Open Weather Map][owm] |
| `location` | `string` | The requested location. Formatted as <City,STATE,COUNTRY_CODE>. City name, state code and country code divided by comma. Please, refer to ISO 3166 for the state codes or country codes - defaults to `DE BILT,NL` |
| `units` | `string` | Units of measurement. Available values are standard (kelvin), metric (celsius), and imperial (fahrenheit) - defaults to `standard` |
| `http_timeout` | `int` | The default timeout for http request is 20ms. |
| `cache_timeout` | `int` | The default timeout for request caching is 10m. A value of 0 disables the cache. |
| `template` | `string` | A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the properties below - defaults to `{{.Weather}} ({{.Temperature}}{{.UnitIcon}})` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Weather }} ({{ .Temperature }}{{ .UnitIcon }})
```
@ -58,10 +56,12 @@ properties below - defaults to `{{.Weather}} ({{.Temperature}}{{.UnitIcon}})`
### Properties
- `.Weather`: `string` - the current weather icon
- `.Temperature`: `int` - the current temperature
- `.UnitIcon`: `string` - the current unit icon(based on units property)
- `.URL`: `string` - the url of the current api call
| Name | Type | Description |
| -------------- | -------- | ---------------------------------------------- |
| `.Weather` | `string` | the current weather icon |
| `.Temperature` | `int` | the current temperature |
| `.UnitIcon` | `string` | the current unit icon(based on units property) |
| `.URL` | `string` | the url of the current api call |
[templates]: /docs/configuration/templates
[owm]: https://openweathermap.org

View file

@ -28,17 +28,17 @@ Display the current path.
## Properties
- folder_separator_icon: `string` - the symbol to use as a separator between folders - defaults to platform path separator
- folder_separator_template: `string` - the [template][templates] to use as a separator between folders - defaults to ``
- home_icon: `string` - the icon to display when at `$HOME` - defaults to `~`
- folder_icon: `string` - the icon to use as a folder indication - defaults to `..`
- windows_registry_icon: `string` - the icon to display when in the Windows registry - defaults to `\uE0B1`
- style: `enum` - how to display the current path
- mixed_threshold: `number` - the maximum length of a path segment that will be displayed when using `Mixed` -
defaults to `4`
- max_depth: `number` - maximum path depth to display before shortening when using `agnoster_short` - defaults to `1`
- hide_root_location: `boolean` - hides the root location if it doesn't fit in the last `max_depth` folders, when using
`agnoster_short` - defaults to `false`
| Name | Type | Description |
| --------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `folder_separator_icon` | `string` | the symbol to use as a separator between folders - defaults to platform path separator |
| `folder_separator_template` | `string` | the [template][templates] to use as a separator between folders - defaults to `` |
| `home_icon` | `string` | the icon to display when at `$HOME`, defaults to `~` |
| `folder_icon` | `string` | the icon to use as a folder indication - defaults to `..` |
| `windows_registry_icon` | `string` | the icon to display when in the Windows registry - defaults to `\uE0B1` |
| `style` | `enum` | how to display the current path |
| `mixed_threshold` | `number` | the maximum length of a path segment that will be displayed when using `Mixed` - defaults to `4` |
| `max_depth` | `number` | maximum path depth to display before shortening when using `agnoster_short`, defaults to `1` |
| `hide_root_location` | `boolean` | hides the root location if it doesn't fit in the last `max_depth` folders, when using `agnoster_short` - defaults to `false` |
## Mapped Locations
@ -46,9 +46,11 @@ Allows you to override a location with an icon. It validates if the current path
it with the icon if there's a match. To avoid issues with nested overrides, Oh My Posh will sort the list of mapped
locations before doing a replacement.
- mapped_locations_enabled: `boolean` - replace known locations in the path with the replacements before applying the
style - defaults to `true`
- mapped_locations: `object` - custom glyph/text for specific paths. Works regardless of the `mapped_locations_enabled`
| Name | Type | Description |
| -------------------------- | --------- | -------------------------------------------------------------------------------------------------------- |
| `mapped_locations_enabled` | `boolean` | replace known locations in the path with the replacements before applying the style - defaults to `true` |
| `mapped_locations` | `object` | custom glyph/text for specific paths. Works regardless of the `mapped_locations_enabled` |
setting.
For example, to swap out `C:\Users\Leet\GitHub` with a GitHub icon, you can do the following:
@ -62,26 +64,26 @@ For example, to swap out `C:\Users\Leet\GitHub` with a GitHub icon, you can do t
### Notes
- Oh My Posh will accept both `/` and `\` as path separators for a mapped location and will match regardless of which
is used by the current operating system.
is used by the current operating system.
- The character `~` at the start of a mapped location will match the user's home directory.
- The match is case-insensitive on Windows and macOS, but case-sensitive on other operating systems.
This means that for user Bill, who has a user account `Bill` on Windows and `bill` on Linux, `~/Foo` might match
This means that for user Bill, who has a user account `Bill` on Windows and `bill` on Linux, `~/Foo` might match
`C:\Users\Bill\Foo` or `C:\Users\Bill\foo` on Windows but only `/home/bill/Foo` on Linux.
## Style
Style sets the way the path is displayed. Based on previous experience and popular themes, there are 5 flavors.
- agnoster
- agnoster_full
- agnoster_short
- agnoster_left
- full
- folder
- mixed
- letter
- unique
- `agnoster`
- `agnoster_full`
- `agnoster_short`
- `agnoster_left`
- `full`
- `folder`
- `mixed`
- `letter`
- `unique`
### Agnoster
@ -138,7 +140,7 @@ folders at the same level, so if `C:\projectA\dev` and `C:\projectB\dev` exist,
:::note default template
``` template
```template
{{ .Path }}
```
@ -146,10 +148,12 @@ folders at the same level, so if `C:\projectA\dev` and `C:\projectB\dev` exist,
### Properties
- `.Path`: `string` - the current directory (based on the `style` property)
- `.Parent`: `string` - the current directory's parent folder (designed for use with style `folder`)
- `.Location`: `string` - the current directory (raw value)
- `.StackCount`: `int` - the stack count
- `.Writable`: `boolean` - is the current directory writable by the user or not
| Name | Type | Description |
| ------------- | --------- | ---------------------------------------------------------------------------- |
| `.Path` | `string` | the current directory (based on the `style` property) |
| `.Parent` | `string` | the current directory's parent folder (designed for use with style `folder`) |
| `.Location` | `string` | the current directory (raw value) |
| `.StackCount` | `int` | the stack count |
| `.Writable` | `boolean` | is the current directory writable by the user or not |
[templates]: /docs/configuration/templates

View file

@ -23,22 +23,18 @@ Display the currently active perl version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the perl version - defaults to `true`
- missing_command_text: `string` - text to display when the perl command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when one of the following files is present:
- `.perl-version`
- `*.pl`
- `*.p,`
- `*.t`
| Name | Type | Description |
| ---------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the perl version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the perl command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when one of the following files is present (**default**):<ul><li>`.perl-version`</li><li>`*.pl`</li><li>`*.p`</li><li>`*.t`</li></ul></li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -46,10 +42,12 @@ Display the currently active perl version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
[templates]: /docs/configuration/templates

View file

@ -17,27 +17,25 @@ Display the currently active php version.
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#4063D8",
"template": " \ue73d {{ .Full }} ",
"template": " \ue73d {{ .Full }} "
}
```
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the php version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.php`, `composer.json`, `composer.lock`, `.php-version` or `blade.php`
files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the php version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when one of the following files is present (**default**):<ul><li>`*.php`</li><li>`composer.json`</li><li>`composer.lock`</li><li>`.php-version`</li><li>`blade.php`</li></ul></li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -45,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -10,14 +10,6 @@ Display Plastic SCM information when in a plastic repository. Also works for sub
For maximum compatibility, make sure your `cm` executable is up-to-date
(when branch or status information is incorrect for example).
Local changes can also be displayed which uses the following syntax (see `.Status` property below):
- `+` added
- `~` modified
- `-` deleted
- `>` moved
- `x` unmerged
## Sample Configuration
```json
@ -55,27 +47,31 @@ by leaving a like!
As doing multiple `cm` calls can slow down the prompt experience, we do not fetch information by default.
You can set the following property to `true` to enable fetching additional information (and populate the template).
- fetch_status: `boolean` - fetch the local changes - defaults to `false`
|`fetch_status`|`boolean`|fetch the local changes - defaults to `false`|
### Icons
#### Branch
- branch_icon: `string` - the icon to use in front of the git branch name - defaults to `\uE0A0 `
- full_branch_path: `bool` - display the full branch path: */main/fix-001* instead of *fix-001* - defaults to `true`
- branch_max_length: `int` - the max length for the displayed branch name where `0` implies full length - defaults to `0`
- truncate_symbol: `string` - the icon to display when a branch name is truncated - defaults to empty
| Name | Type | Description |
| ------------------- | -------- | -------------------------------------------------------------------------------------------- |
| `branch_icon` | `string` | the icon to use in front of the git branch name - defaults to `\uE0A0 ` |
| `full_branch_path` | `bool` | display the full branch path: `_/main/fix-001_` instead of `_fix-001_` - defaults to `true` |
| `branch_max_length` | `int` | the max length for the displayed branch name where `0` implies full length - defaults to `0` |
| `truncate_symbol` | `string` | the icon to display when a branch name is truncated - defaults to empty |
#### Selector
- commit_icon: `string` - icon/text to display before the commit context (detached HEAD) - defaults to `\uF417`
- tag_icon: `string` - icon/text to display before the tag context - defaults to `\uF412`
| Name | Type | Description |
| ------------- | -------- | ------------------------------------------------------------------------------------- |
| `commit_icon` | `string` | icon/text to display before the commit context (detached HEAD) - defaults to `\uF417` |
| `tag_icon` | `string` | icon/text to display before the tag context - defaults to `\uF412` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Selector }}
```
@ -83,21 +79,34 @@ You can set the following property to `true` to enable fetching additional infor
### Properties
- `.Selector`: `string` - the current selector context (branch/changeset/label)
- `.Behind`: `bool` - the current workspace is behind and changes are incoming
- `.Status`: `PlasticStatus` - changes in the workspace (see below)
- `.MergePending`: `bool` - if a merge is pending and needs to be commited
(kown issue: when no file is left after a *Change/Delete conflict* merge, the `MergePending` property is not set)
| Name | Type | Description |
| --------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.Selector` | `string` | the current selector context (branch/changeset/label) |
| `.Behind` | `bool` | the current workspace is behind and changes are incoming |
| `.Status` | `PlasticStatus` | changes in the workspace (see below) |
| `.MergePending` | `bool` | if a merge is pending and needs to be commited (known issue: when no file is left after a _Change/Delete conflict_ merge, the `MergePending` property is not set) |
### PlasticStatus
- `.Unmerged`: `int` - number of unmerged changes
- `.Deleted`: `int` - number of deleted changes
- `.Added`: `int` - number of added changes
- `.Modified`: `int` - number of modified changes
- `.Moved`: `int` - number of moved changes
- `.Changed`: `boolean` - if the status contains changes or not
- `.String`: `string` - a string representation of the changes above
| Name | Type | Description |
| ----------- | --------- | -------------------------------------------- |
| `.Unmerged` | `int` | number of unmerged changes |
| `.Deleted` | `int` | number of deleted changes |
| `.Added` | `int` | number of added changes |
| `.Modified` | `int` | number of modified changes |
| `.Moved` | `int` | number of moved changes |
| `.Changed` | `boolean` | if the status contains changes or not |
| `.String` | `string` | a string representation of the changes above |
Local changes use the following syntax:
| Icon | Description |
| ---- | ----------- |
| `+` | added |
| `~` | modified |
| `-` | deleted |
| `v` | moved |
| `x` | unmerged |
[templates]: /docs/configuration/templates
[fa-issue]: https://github.com/FortAwesome/Font-Awesome/issues/18504

View file

@ -33,7 +33,7 @@ Supports:
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }}
```
@ -41,7 +41,9 @@ Supports:
### Properties
- `.Version`: `string` - The version of your project
- `.Name`: `string` - The name of your project
| Name | Type | Description |
| ---------- | -------- | --------------------------- |
| `.Version` | `string` | The version of your project |
| `.Name` | `string` | The name of your project |
[templates]: /docs/configuration/templates

View file

@ -24,26 +24,21 @@ Supports conda, virtualenv and pyenv (if python points to pyenv shim).
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_virtual_env: `boolean` - fetch the name of the virtualenv or not - defaults to `true`
- display_default: `boolean` - show the name of the virtualenv when it's default (`system`, `base`)
or not - defaults to `true`
- fetch_version: `boolean` - fetch the python version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.py`, `*.ipynb`, `pyproject.toml`, `venv.bak`, `venv`, or `.venv`
files are present
- `environment`: the segment is only displayed when a virtual env is present (default)
- `context`: the segment is only displayed when either `environment` or `files` is active
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_virtual_env` | `boolean` | fetch the name of the virtualenv or not - defaults to `true` |
| `display_default` | `boolean` | show the name of the virtualenv when it's default (`system`, `base`) or not - defaults to `true` |
| `fetch_version` | `boolean` | fetch the python version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when one of the following files is present:<ul><li>`*.py`</li><li>`*.ipynb`</li><li>`pyproject.toml`</li><li>`venv.bak`</li><li>`venv`</li><li>`.venv`</li></ul></li><li>`environment`: the segment is only displayed when a virtual env is present (**default**)</li><li>`context`: the segment is only displayed when either `environment` or `files` is active</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}
```
@ -51,13 +46,15 @@ the URL of the version info / release notes
### Properties
- `.Venv`: `string` - the virtual environment name (if present)
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Venv` | `string` | the virtual environment name (if present) |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,21 +23,19 @@ Display the currently active [R][r-homepage] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the R version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.R`, `*.Rmd`, `*.Rsx`, `*.Rda`, `*.Rd`, `*.Rproj`, or `.Rproj.user`
files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the R version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when one of the following files is present (**default**):<ul><li>`*.R`</li><li>`*.Rmd`</li><li>`*.Rsx`</li><li>`*.Rda`</li><li>`*.Rd`</li><li>`*.Rproj`</li><li>`.Rproj.user`</li></ul></li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -45,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -23,18 +23,18 @@ Display the currently active ruby version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the ruby version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.rb`, `Gemfile` or `Rakefile` files are present (default)
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the ruby version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.rb`, `Gemfile` or `Rakefile` files are present (**default**)</li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -42,10 +42,12 @@ Display the currently active ruby version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
[templates]: /docs/configuration/templates

View file

@ -23,18 +23,18 @@ Display the currently active rust version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the rust version (`rustc --version`) - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.rs`, `Cargo.toml` or `Cargo.lock` files are present (default)
| Name | Type | Description |
| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the rust version (`rustc --version`) - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.rs`, `Cargo.toml` or `Cargo.lock` files are present (**default**)</li></ul> |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -42,10 +42,12 @@ Display the currently active rust version.
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.Error` | `string` | error encountered when fetching the version string |
[templates]: /docs/configuration/templates

View file

@ -26,7 +26,7 @@ Show the current user and host name.
:::note default template
``` template
```template
{{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }}@{{ .HostName }}
```
@ -34,9 +34,11 @@ Show the current user and host name.
### Properties
- `.UserName`: `string` - the current user's name
- `.HostName`: `string` - the current computer's name
- `.SSHSession`: `boolean` - active SSH session or not
- `.Root`: `boolean` - are you a root/admin user or not
| Name | Type | Description |
| ------------- | --------- | -------------------------------- |
| `.UserName` | `string` | the current user's name |
| `.HostName` | `string` | the current computer's name |
| `.SSHSession` | `boolean` | active SSH session or not |
| `.Root` | `boolean` | are you a root/admin user or not |
[templates]: /docs/configuration/templates

View file

@ -27,13 +27,13 @@ Show the current shell name (zsh, PowerShell, bash, ...).
## Properties
- mapped_shell_names: `object` - custom glyph/text to use in place of specified shell names (case-insensitive)
|`mapped_shell_names`|`object`|custom glyph/text to use in place of specified shell names (case-insensitive)|
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Name }}
```
@ -41,7 +41,9 @@ Show the current shell name (zsh, PowerShell, bash, ...).
### Properties
- `.Name`: `string` - the shell name
- `.Version`: `string` - the shell version
| Name | Type | Description |
| ---------- | -------- | ----------------- |
| `.Name` | `string` | the shell name |
| `.Version` | `string` | the shell version |
[templates]: /docs/configuration/templates

View file

@ -34,15 +34,17 @@ On _Windows/WSL_, **only the playing state is supported** (no information when p
## Properties
- playing_icon: `string` - text/icon to show when playing - defaults to `\uE602 `
- paused_icon: `string` - text/icon to show when paused - defaults to `\uF8E3 `
- stopped_icon: `string` - text/icon to show when stopped - defaults to `\uF04D `
| Name | Type | Description |
| -------------- | -------- | ------------------------------------------------------ |
| `playing_icon` | `string` | text/icon to show when playing - defaults to `\uE602 ` |
| `paused_icon` | `string` | text/icon to show when paused - defaults to `\uF8E3 ` |
| `stopped_icon` | `string` | text/icon to show when stopped - defaults to `\uF04D ` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}
```
@ -50,10 +52,12 @@ On _Windows/WSL_, **only the playing state is supported** (no information when p
### Properties
- `.Status`: `string` - player status (`playing`, `paused`, `stopped`)
- `.Artist`: `string` - current artist
- `.Track`: `string` - current track
- `.Icon`: `string` - icon (based on `.Status`)
| Name | Type | Description |
| --------- | -------- | ---------------------------------------------- |
| `.Status` | `string` | player status (`playing`, `paused`, `stopped`) |
| `.Artist` | `string` | current artist |
| `.Track` | `string` | current track |
| `.Icon` | `string` | icon (based on `.Status`) |
[templates]: /docs/configuration/templates
[spotify]: https://www.spotify.com

View file

@ -4,7 +4,7 @@ title: Strava
sidebar_label: Strava
---
import StravaConnect from '/img/strava_connect.svg';
import StravaConnect from "/img/strava_connect.svg";
## What
@ -21,7 +21,7 @@ This will give you an access and a refresh token. Paste the tokens into your Str
Click the following link to connect with Strava:
<a href="https://www.strava.com/oauth/authorize?client_id=76033&response_type=code&redirect_uri=https://ohmyposh.dev/api/auth&approval_prompt=force&scope=read,activity:read&state=strava">
<StravaConnect/>
<StravaConnect />
</a>
## Sample Configuration
@ -49,8 +49,8 @@ if that color is visible against any of your backgrounds.
],
"template": " {{.Name}} {{.Ago}} {{.Icon}} ",
"properties": {
"access_token":"11111111111111111",
"refresh_token":"1111111111111111",
"access_token": "11111111111111111",
"refresh_token": "1111111111111111",
"http_timeout": 1500
}
}
@ -58,22 +58,24 @@ if that color is visible against any of your backgrounds.
## Properties
- access_token: `string` - token from Strava login, see login link in section above.
- refresh_token: `string` - token from Strava login, see login link in section above.
- expires_in: `int` - the default timeout of the token from the Strava login
- http_timeout: `int` - how long do you want to wait before you want to see your prompt more than your strava data? - defaults to 500ms
- CacheTimeout: `int` in minutes - How long do you want your Strava data cached? - defaults to 5 min
- RideIcon - defaults to `\uf5a2`
- RunIcon - defaults to `\ufc0c`
- SkiingIcon - defaults to `\ue213`
- WorkOutIcon - defaults to `\ue213`
- UnknownActivityIcon - defaults to `\ue213`
| Name | Type | Description |
| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| `access_token` | `string` | token from Strava login, see login link in section above. |
| `refresh_token` | `string` | token from Strava login, see login link in section above. |
| `expires_in` | `int` | the default timeout of the token from the Strava login |
| `http_timeout` | `int` | how long do you want to wait before you want to see your prompt more than your strava data? - defaults to 500ms |
| `CacheTimeout` | `int` | in minutes - How long do you want your Strava data cached? - defaults to 5 min |
| `RideIcon` | `string` | defaults to `\uf5a2` |
| `RunIcon` | `string` | defaults to `\ufc0c` |
| `SkiingIcon` | `string` | defaults to `\ue213` |
| `WorkOutIcon` | `string` | defaults to `\ue213` |
| `UnknownActivityIcon` | `string` | defaults to `\ue213` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Ago }}{{ end }}
```
@ -83,21 +85,23 @@ if that color is visible against any of your backgrounds.
The properties below are available for use in your template
- `.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
| 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 |
Now, go out and have a fun ride or run!

View file

@ -9,14 +9,6 @@ sidebar_label: Subversion
Display subversion information when in a subversion repository. Also works for subfolders. For maximum compatibility,
make sure your `svn` executable is up-to-date (when branch or status information is incorrect for example).
Local changes can also be displayed which uses the following syntax:
- `+` added
- `!` conflicted
- `-` deleted
- `~` modified
- `>` moved
## Sample Configuration
```json
@ -39,15 +31,16 @@ Local changes can also be displayed which uses the following syntax:
As doing multiple [subversion][svn] calls can slow down the prompt experience, we do not fetch information by default.
You can set the following properties to `true` to enable fetching additional information (and populate the template).
- fetch_status: `boolean` - fetch the local changes - defaults to `false`
- native_fallback: `boolean` - when set to `true` and `svn.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native svn
executable to fetch data. Not all information can be displayed in this case. Defaults to `false`.
| Name | Type | Description |
| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fetch_status` | `boolean` | fetch the local changes - defaults to `false` |
| `native_fallback` | `boolean` | when set to `true` and `svn.exe` is not available when inside a WSL2 shared Windows drive, we will fallback to the native svn executable to fetch data. Not all information can be displayed in this case. Defaults to `false`. |
## Template ([info][templates])
:::note default template
``` template
```template
\ue0a0{{.Branch}} r{{.BaseRev}} {{.Working.String}}
```
@ -55,20 +48,34 @@ executable to fetch data. Not all information can be displayed in this case. Def
### Properties
- `.Working`: `SvnStatus` - changes in the worktree (see below)
- `.Branch`: `string` - current branch (releative URL reported by `svn info`)
- `.BaseRev`: `int` - the currently checked out revision number
| Name | Type | Description |
| ---------- | ----------- | ----------------------------------------------------- |
| `.Working` | `SvnStatus` | changes in the worktree (see below) |
| `.Branch` | `string` | current branch (releative URL reported by `svn info`) |
| `.BaseRev` | `int` | the currently checked out revision number |
### SvnStatus
- `.Modified`: `int` - number of modified files
- `.Deleted`: `int` - number of deleted files
- `.Added`: `int` - number of added files
- `.Moved`: `int` - number of changed moved files
- `.Conflicted`: `int` - number of changed tracked files with conflicts
- `.Changed`: `boolean` - if the status contains changes or not
- `.HasConflicts`: `boolean` - if the status contains conflicts or not
- `.String`: `string` - a string representation of the changes above
| Name | Type | Description |
| --------------- | --------- | ---------------------------------------------- |
| `.Modified` | `int` | number of modified files |
| `.Deleted` | `int` | number of deleted files |
| `.Added` | `int` | number of added files |
| `.Moved` | `int` | number of changed moved files |
| `.Conflicted` | `int` | number of changed tracked files with conflicts |
| `.Changed` | `boolean` | if the status contains changes or not |
| `.HasConflicts` | `boolean` | if the status contains conflicts or not |
| `.String` | `string` | a string representation of the changes above |
Local changes use the following syntax:
| Icon | Description |
| ---- | ----------- |
| `+` | added |
| `!` | conflicted |
| `-` | deleted |
| `~` | modified |
| `>` | moved |
[svn]: https://subversion.apache.org
[templates]: /docs/config-templates

View file

@ -23,20 +23,19 @@ Display the currently active [Swift][swift] version.
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the swift version - defaults to `true`
- missing_command_text: `string` - text to display when the command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*.swift` or `*.SWIFT` files are present (default)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the swift version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*.swift` or `*.SWIFT` files are present (**default**)</li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}
```
@ -44,12 +43,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -26,13 +26,15 @@ Display SysInfo.
## Properties
- Precision: `int` - The precision used for any float values - defaults to 2
| Name | Type | Description |
| ----------- | ----- | ------------------------------------------------------- |
| `Precision` | `int` | The precision used for any float values - defaults to 2 |
## Template ([info][templates])
:::note default template
``` template
```template
{{ round .PhysicalPercentUsed .Precision }}
```
@ -40,19 +42,20 @@ Display SysInfo.
### Properties
- `.PhysicalTotalMemory`: `int` - is the total of used physical memory
- `.PhysicalAvailableMemory`: `int` - is the total available physical memory (i.e. the amount immediately available to processes)
- `.PhysicalFreeMemory`: `int` - is the total of free physical memory (i.e. considers memory used by the system for any reason
[e.g. caching] as occupied)
- `.PhysicalPercentUsed`: `float64` - is the percentage of physical memory in usage
- `.SwapTotalMemory`: `int` - is the total of used swap memory
- `.SwapFreeMemory`: `int` - is the total of free swap memory
- `.SwapPercentUsed`: `float64` - is the percentage of swap memory in usage
- `.Load1`: `float64` - is the current load1 (can be empty on windows)
- `.Load5`: `float64` - is the current load5 (can be empty on windows)
- `.Load15`: `float64` - is the current load15 (can be empty on windows)
- `.CPU`: `[]struct` - an array of [InfoStat][cpuinfo] object, you can use any property it has e.g. `(index .CPU 0).Cores`
- `.Disks`: `[]struct` - an array of [IOCountersStat][ioinfo] object, you can use any property it has e.g. `.Disks.disk0.IoTime`
| Name | Type | Description |
| -------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------- |
| `.PhysicalTotalMemory` | `int` | is the total of used physical memory |
| `.PhysicalAvailableMemory` | `int` | is the total available physical memory (i.e. the amount immediately available to processes) |
| `.PhysicalFreeMemory` | `int` | is the total of free physical memory (i.e. considers memory used by the system for any reason [e.g. caching] as occupied) |
| `.PhysicalPercentUsed` | `float64` | is the percentage of physical memory in usage |
| `.SwapTotalMemory` | `int` | is the total of used swap memory |
| `.SwapFreeMemory` | `int` | is the total of free swap memory |
| `.SwapPercentUsed` | `float64` | is the percentage of swap memory in usage |
| `.Load1` | `float64` | is the current load1 (can be empty on windows) |
| `.Load5` | `float64` | is the current load5 (can be empty on windows) |
| `.Load15` | `float64` | is the current load15 (can be empty on windows) |
| `.CPU` | `[]struct` | an array of [InfoStat][cpuinfo] object, you can use any property it has e.g. `(index .CPU 0).Cores` |
| `.Disks` | `[]struct` | an array of [IOCountersStat][ioinfo] object, you can use any property it has e.g. `.Disks.disk0.IoTime` |
[cpuinfo]: https://github.com/shirou/gopsutil/blob/78065a7ce2021f6a78c8d6f586a2683ba501dcec/cpu/cpu.go#L32
[ioinfo]: https://github.com/shirou/gopsutil/blob/e0ec1b9cda4470db704a862282a396986d7e930c/disk/disk.go#L32

View file

@ -27,14 +27,17 @@ This requires a terraform binary in your PATH and will only show in directories
## Properties
- fetch_version: `boolean` - fetch the version information from `versions.tf`, `main.tf` or `terraform.tfstate` -
| Name | Type | Description |
| --------------- | --------- | ---------------------------------------------------------------------------------- |
| `fetch_version` | `boolean` | fetch the version information from `versions.tf`, `main.tf` or `terraform.tfstate` |
defaults to `false`
## Template ([info][templates])
:::note default template
``` template
```template
{{ .WorkspaceName }}{{ if .Version }} {{ .Version }}{{ end }}
```
@ -42,7 +45,9 @@ defaults to `false`
### Properties
- `.WorkspaceName`: `string` - is the current workspace name
- `.Version`: `string` - terraform version (set `fetch_version` to `true`)
| Name | Type | Description |
| ---------------- | -------- | ------------------------------------------------- |
| `.WorkspaceName` | `string` | is the current workspace name |
| `.Version` | `string` | terraform version (set `fetch_version` to `true`) |
[templates]: /docs/configuration/templates

View file

@ -23,13 +23,15 @@ Display text.
### Properties
- `.Root`: `boolean` - is the current user root/admin or not
- `.Path`: `string` - the current working directory
- `.Folder`: `string` - the current working folder
- `.Shell`: `string` - the current shell name
- `.UserName`: `string` - the current user name
- `.HostName`: `string` - the host name
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
| Name | Type | Description |
| -------------- | --------- | ------------------------------------------------------------------------- |
| `.Root` | `boolean` | is the current user root/admin or not |
| `.Path` | `string` | the current working directory |
| `.Folder` | `string` | the current working folder |
| `.Shell` | `string` | the current shell name |
| `.UserName` | `string` | the current user name |
| `.HostName` | `string` | the host name |
| `.Env.VarName` | `string` | Any environment variable where `VarName` is the environment variable name |
[coloring]: /docs/configuration/colors
[templates]: /docs/configuration/templates

View file

@ -23,13 +23,15 @@ Show the current timestamp.
## Properties
- time_format: `string` - format to use, follows the [golang standard][format] - defaults to `15:04:05`
| Name | Type | Description |
| ------------- | -------- | ----------------------------------------------------------------------------- |
| `time_format` | `string` | format to use, follows the [golang standard][format] - defaults to `15:04:05` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .CurrentDate | date .Format }}
```
@ -37,18 +39,20 @@ Show the current timestamp.
### Properties
- `.Format`: `string` - The time format (set via `time_format`)
- `.CurrentDate`: `time` - The time to display (testing purpose)
| Name | Type | Description |
| -------------- | -------- | --------------------------------------- |
| `.Format` | `string` | The time format (set via `time_format`) |
| `.CurrentDate` | `time` | The time to display (testing purpose) |
## Standard time and date formats
## Syntax
- January 2, 2006 **Date**
- 01/02/06
- Jan-02-06
- 15:04:05 **Time**
- 3:04:05 PM
- Jan _2 15:04:05 **Timestamp**
- Jan _2 15:04:05.000000 **with microseconds**
- Jan 2 15:04:05 **Timestamp**
- Jan 2 15:04:05.000000 **with microseconds**
- 2006-01-02T15:04:05-0700 **ISO 8601 (RFC 3339)**
- 2006-01-02
- 15:04:05
@ -57,24 +61,27 @@ Show the current timestamp.
- Mon, 02 Jan 2006 15:04:05 MST 27e95cb
- Mon, 02 Jan 2006 15:04:05 -0700 **with numeric zone**
### The following predefined date and timestamp format constants are also available
### Formats
- ANSIC = "Mon Jan _2 15:04:05 2006"
- UnixDate = "Mon Jan _2 15:04:05 MST 2006"
- RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
- RFC822 = "02 Jan 06 15:04 MST"
- RFC822Z = "02 Jan 06 15:04 -0700"
- RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
- RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
- RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700"
- RFC3339 = "2006-01-02T15:04:05Z07:00"
- RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
- Kitchen = "3:04PM"
// Useful time stamps.
- Stamp = "Jan _2 15:04:05"
- StampMilli = "Jan _2 15:04:05.000"
- StampMicro = "Jan _2 15:04:05.000000"
- StampNano = "Jan _2 15:04:05.000000000"
The following predefined date and timestamp format constants are also available:
| Name | Output |
| ------------- | ----------------------------------- |
| `ANSIC` | Mon Jan 2 15:04:05 2006 |
| `UnixDate` | Mon Jan 2 15:04:05 MST 2006 |
| `RubyDate` | Mon Jan 02 15:04:05 -0700 2006 |
| `RFC822` | 02 Jan 06 15:04 MST |
| `RFC822Z` | 02 Jan 06 15:04 -0700 |
| `RFC850` | Monday, 02-Jan-06 15:04:05 MST |
| `RFC1123` | Mon, 02 Jan 2006 15:04:05 MST |
| `RFC1123Z` | Mon, 02 Jan 2006 15:04:05 -0700 |
| `RFC3339` | 2006-01-02T15:04:05Z07:00 |
| `RFC3339Nano` | 2006-01-02T15:04:05.999999999Z07:00 |
| `Kitchen` | 3:04PM |
| `Stamp` | Jan 2 15:04:05 |
| `StampMilli` | Jan 2 15:04:05.000 |
| `StampMicro` | Jan 2 15:04:05.000000 |
| `StampNano` | Jan 2 15:04:05.000000000 |
## Examples

View file

@ -24,16 +24,13 @@ see [the documentation][ui5-version-help]).
## Properties
- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false`
- fetch_version: `boolean` - display the UI5 tooling version - defaults to `true`
- missing_command_text: `string` - text to display when the java command is missing - defaults to empty
- display_mode: `string` - determines when the segment is displayed
- `always`: the segment is always displayed
- `files`: the segment is only displayed when `*ui5*.y(a)ml` file is present in the current folder
- `context`: (default) the segment is only displayed when `*ui5*.y(a)ml` file is present in the current folder
or it has been found in the parent folders (check up to 4 levels)
- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates
the URL of the version info / release notes
| Name | Type | Description |
| ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `home_enabled` | `boolean` | display the segment in the HOME folder or not - defaults to `false` |
| `fetch_version` | `boolean` | display the UI5 tooling version - defaults to `true` |
| `missing_command_text` | `string` | text to display when the java command is missing - defaults to empty |
| `display_mode` | `string` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when `*ui5*.y(a)ml` file is present in the current folder</li><li>`context`: the segment is only displayed when `*ui5*.y(a)ml` file is present in the current folder or it has been found in the parent folders (check up to 4 levels) (**default**) </li></ul> |
| `version_url_template` | `string` | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
## Template ([info][templates])
@ -47,12 +44,14 @@ the URL of the version info / release notes
### Properties
- `.Full`: `string` - the full version
- `.Major`: `string` - major number
- `.Minor`: `string` - minor number
- `.Patch`: `string` - patch number
- `.URL`: `string` - URL of the version info / release notes
- `.Error`: `string` - error encountered when fetching the version string
| Name | Type | Description |
| -------- | -------- | -------------------------------------------------- |
| `.Full` | `string` | the full version |
| `.Major` | `string` | major number |
| `.Minor` | `string` | minor number |
| `.Patch` | `string` | patch number |
| `.URL` | `string` | URL of the version info / release notes |
| `.Error` | `string` | error encountered when fetching the version string |
[go-text-template]: https://golang.org/pkg/text/template/
[templates]: /docs/configuration/templates

View file

@ -34,16 +34,17 @@ The free tier for is sufficient. You'll find the API key in your profile setting
## Properties
- url: `string` - Your Wakatime [summaries][wk-summaries] URL, including the API key. Example above. You'll know this
works if you can curl it yourself and a result. - defaults to ``
- http_timeout: `int` - The default timeout for http request is 20ms. If no segment is shown, try increasing this timeout.
- cache_timeout: `int` - The default timeout for request caching is 10m. A value of 0 disables the cache.
| Name | Type | Description |
| ----- | -------- | --------------------------------------------------------------------------------------------------- |
| `url` | `string` | Your Wakatime [summaries][wk-summaries] URL, including the API key. Example above. You'll know this |
works if you can curl it yourself and a result. - defaults to `` |`http_timeout`|`int`|The default timeout for http request is 20ms. If no segment is shown, try increasing this timeout.| |`cache_timeout`|`int`|The default timeout for request caching is 10m. A value of 0 disables the cache.|
## Template ([info][templates])
:::note default template
``` template
```template
{{ secondsRound .CummulativeTotal.Seconds }}
```
@ -51,12 +52,16 @@ works if you can curl it yourself and a result. - defaults to ``
### Properties
- `.CummulativeTotal`: `wtTotals` - object holding total tracked time values
| Name | Type | Description |
| ------------------- | ---------- | ---------------------------------------- |
| `.CummulativeTotal` | `wtTotals` | object holding total tracked time values |
### wtTotals Properties
- `.Seconds`: `float64` - a number reprecenting the total tracked time in seconds
- `.Text`: `string` - a string with human readable tracked time (eg: "2 hrs 30 mins")
| Name | Type | Description |
| ---------- | --------- | --------------------------------------------------------------- |
| `.Seconds` | `float64` | a number reprecenting the total tracked time in seconds |
| `.Text` | `string` | a string with human readable tracked time (eg: "2 hrs 30 mins") |
[wt]: https://wakatime.com
[wk-summaries]: https://wakatime.com/developers#summaries

View file

@ -32,7 +32,7 @@ Currently only supports Windows and WSL. Pull requests for Darwin and Linux supp
:::note default template
``` template
```template
{{ if .Error }}{{ .Error }}{{ else }}\uFAA8 {{ .SSID }} {{ .Signal }}% {{ .ReceiveRate }}Mbps{{ end }}
```
@ -40,12 +40,14 @@ Currently only supports Windows and WSL. Pull requests for Darwin and Linux supp
### Properties
- `.SSID`: `string` - the SSID of the current wifi network
- `.RadioType`: `string` - the radio type - _e.g. 802.11ac, 802.11ax, 802.11n, etc._
- `.Authentication`: `string` - the authentication type - _e.g. WPA2-Personal, WPA2-Enterprise, etc._
- `.Channel`: `int` - the current channel number
- `.ReceiveRate`: `int` - the receive rate (Mbps)
- `.TransmitRate`: `int` - the transmit rate (Mbps)
- `.Signal`: `int` - the signal strength (%)
| Name | Type | Description |
| ----------------- | -------- | --------------------------------------------------------------------- |
| `.SSID` | `string` | the SSID of the current wifi network |
| `.RadioType` | `string` | the radio type - _e.g. 802.11ac, 802.11ax, 802.11n, etc._ |
| `.Authentication` | `string` | the authentication type - _e.g. WPA2-Personal, WPA2-Enterprise, etc._ |
| `.Channel` | `int` | the current channel number |
| `.ReceiveRate` | `int` | the receive rate (Mbps) |
| `.TransmitRate` | `int` | the transmit rate (Mbps) |
| `.Signal` | `int` | the signal strength (%) |
[templates]: /docs/configuration/templates

View file

@ -35,15 +35,16 @@ Supported registry key types:
## Properties
- path: `string` - registry path to the desired key using backslashes and with a valid root HKEY name.
Ending path with \ will get the (Default) key from that path.
- fallback: `string` - the value to fall back to if no entry is found
| Name | Type | Description |
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `path` | `string` | registry path to the desired key using backslashes and with a valid root HKEY name. Ending path with \ will get the (Default) key from that path |
| `fallback` | `string` | the value to fall back to if no entry is found |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Value }}
```
@ -51,6 +52,8 @@ Supported registry key types:
### Properties
- .Value: `string` - The result of your query, or fallback if not found.
| Name | Type | Description |
| ------ | -------- | --------------------------------------------------- |
| .Value | `string` | The result of your query, or fallback if not found. |
[templates]: /docs/configuration/templates

View file

@ -4,7 +4,7 @@ title: Withings
sidebar_label: Withings
---
import WithingsConnect from '/img/withings.svg';
import WithingsConnect from "/img/withings.svg";
## What
@ -20,7 +20,7 @@ Click the following link to connect with Withings:
<div className="withings">
<a href="https://account.withings.com/oauth2_user/authorize2?client_id=93675962e88ddfe53f83c0c900558f72174e0ac70ccfb57e48053530c7e6e494&response_type=code&redirect_uri=https://ohmyposh.dev/api/auth&scope=user.activity,user.metrics&state=withings">
<WithingsConnect className="withings"/>
<WithingsConnect className="withings" />
</a>
</div>
@ -35,8 +35,8 @@ Click the following link to connect with Withings:
"background": "#000000",
"template": "{{ if gt .Weight 0.0 }} {{ round .Weight 2 }}kg {{ end }}",
"properties": {
"access_token":"11111111111111111",
"refresh_token":"1111111111111111",
"access_token": "11111111111111111",
"refresh_token": "1111111111111111",
"http_timeout": 1500
}
}
@ -44,17 +44,19 @@ Click the following link to connect with Withings:
## Properties
- access_token: `string` - token from Withings login, see login link in section above.
- refresh_token: `string` - token from Withings login, see login link in section above.
- expires_in: `int` - the default timeout of the token from the Withings login
- http_timeout: `int` - how long do you want to wait before you want to see your prompt more than your Withings data? - defaults to 500ms
- CacheTimeout: `int` in minutes - How long do you want your Withings data cached? - defaults to 5 min
| Name | Type | Description |
| --------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `access_token` | `string` | token from Withings login, see login link in section above. |
| `refresh_token` | `string` | token from Withings login, see login link in section above. |
| `expires_in` | `int` | the default timeout of the token from the Withings login |
| `http_timeout` | `int` | how long do you want to wait before you want to see your prompt more than your Withings data? - defaults to 500ms |
| `CacheTimeout` | `int` | in minutes - How long do you want your Withings data cached? - defaults to 5 min |
## Template ([info][templates])
:::note default template
``` template
```template
{{ if gt .Weight 0.0 }} {{ round .Weight 2 }}kg {{ end }}
```
@ -64,9 +66,11 @@ Click the following link to connect with Withings:
The properties below are available for use in your template
- `.Weight`: `float` - your last measured weight
- `.SleepHours`: `string` - your last measured sleep SleepHours
- `.Steps`: `int` - your last measured steps
| Name | Type | Description |
| ------------- | -------- | ----------------------------------- |
| `.Weight` | `float` | your last measured weight |
| `.SleepHours` | `string` | your last measured sleep SleepHours |
| `.Steps` | `int` | your last measured steps |
Now, go out and be active!

View file

@ -32,16 +32,18 @@ Remote Control password.
## Properties
- playing_icon: `string` - text/icon to show when playing - defaults to `\uE602 `
- paused_icon: `string` - text/icon to show when paused - defaults to `\uF8E3 `
- stopped_icon: `string` - text/icon to show when paused - defaults to `\uF04D `
- api_url: `string` - the YTMDA Remote Control API URL- defaults to `http://127.0.0.1:9863`
| Name | Type | Description |
| -------------- | -------- | --------------------------------------------------------------------- |
| `playing_icon` | `string` | text/icon to show when playing - defaults to `\uE602 ` |
| `paused_icon` | `string` | text/icon to show when paused - defaults to `\uF8E3 ` |
| `stopped_icon` | `string` | text/icon to show when paused - defaults to `\uF04D ` |
| `api_url` | `string` | the YTMDA Remote Control API URL- defaults to `http://127.0.0.1:9863` |
## Template ([info][templates])
:::note default template
``` template
```template
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }}
```
@ -49,11 +51,12 @@ Remote Control password.
### Properties
- `.Status`: `string` - player status (`playing`, `paused`, `stopped`)
- `.Artist`: `string` - current artist
- `.Track`: `string` - current track
- `.Icon`: `string` - icon (based on `.Status`)
| Name | Type | Description |
| --------- | -------- | ---------------------------------------------- |
| `.Status` | `string` | player status (`playing`, `paused`, `stopped`) |
| `.Artist` | `string` | current artist |
| `.Track` | `string` | current track |
| `.Icon` | `string` | icon (based on `.Status`) |
[templates]: /docs/configuration/templates
[templates]: /docs/configuration/templates

View file

@ -59,10 +59,10 @@ module.exports = {
"segments/brewfather",
"segments/cds",
"segments/command",
"segments/crystal",
"segments/cf",
"segments/cftarget",
"segments/cmake",
"segments/crystal",
"segments/dart",
"segments/dotnet",
"segments/executiontime",
@ -82,8 +82,8 @@ module.exports = {
"segments/lua",
"segments/nbgv",
"segments/nightscout",
"segments/npm",
"segments/node",
"segments/npm",
"segments/nx",
"segments/os",
"segments/owm",

View file

@ -164,38 +164,78 @@ a.getStarted_Sjon {
}
[data-theme="light"] .themedImage_ToTc {
filter: invert(0%) sepia(8%) saturate(2885%) hue-rotate(67deg) brightness(84%) contrast(87%);
filter: invert(0%) sepia(8%) saturate(2885%) hue-rotate(67deg) brightness(84%)
contrast(87%);
}
[data-theme="dark"] .themedImage_ToTc {
filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(226deg) brightness(102%) contrast(101%);
filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(226deg)
brightness(102%) contrast(101%);
}
/* Fonts */
:root {
--ifm-font-family-monospace: "Inter";
--ifm-font-family-base: "Inter"
--ifm-font-family-base: "Inter";
}
code {
font-family: 'Fira Code', monospace;
font-family: "Fira Code", monospace;
}
code[class*="language-"], pre[class*="language-"] {
font-family: 'Fira Code', monospace;
code[class*="language-"],
pre[class*="language-"] {
font-family: "Fira Code", monospace;
}
/* Dev settings */
[data-theme="dark"] .themedImage_node_modules-\@docusaurus-theme-classic-lib-theme-ThemedImage-styles-module {
filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(226deg) brightness(102%) contrast(101%);
[data-theme="dark"]
.themedImage_node_modules-\@docusaurus-theme-classic-lib-theme-ThemedImage-styles-module {
filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(226deg)
brightness(102%) contrast(101%);
}
[data-theme="light"] .themedImage_node_modules-\@docusaurus-theme-classic-lib-theme-ThemedImage-styles-module {
filter: invert(0%) sepia(8%) saturate(2885%) hue-rotate(67deg) brightness(84%) contrast(87%);
[data-theme="light"]
.themedImage_node_modules-\@docusaurus-theme-classic-lib-theme-ThemedImage-styles-module {
filter: invert(0%) sepia(8%) saturate(2885%) hue-rotate(67deg) brightness(84%)
contrast(87%);
}
a.getStarted_src-pages-styles-module {
color: white;
}
table {
/* We need this to be able to use border-radius. */
border-collapse: separate;
/* Add a 1px border spacing for out box-shadow to fit into. Increase this if you want to increase the border width. */
border-spacing: 1px;
}
table th,
table td {
/* Remove any borders from our stylesheet. */
border: 0;
/* Use the spread value on the box-shadow to set the border width. */
box-shadow: 0 0 0 1px #c8c9cc;
}
table th:first-child {
border-top-left-radius: 6.4px;
}
table th:last-child {
border-top-right-radius: 6.4px;
}
table tr:last-child td:first-child {
border-bottom-left-radius: 6.4px;
}
table tr:last-child td:last-child {
border-bottom-right-radius: 6.4px;
}