docs: added wifi docs and schema

This commit is contained in:
Mike Sigsworth 2021-11-23 10:31:02 -07:00 committed by Jan De Dobbeleer
parent 4a68c444c6
commit 9232a039ec
2 changed files with 38 additions and 12 deletions

View file

@ -6,7 +6,11 @@ sidebar_label: WiFi
## What
Show details about the connected WiFi network.
Show details about the currently connected WiFi network.
::info
Currently only supports Windows and WSL. Pull requests for Darwin and Linux support are welcome :)
:::
## Sample Configuration
@ -15,29 +19,30 @@ Show details about the connected WiFi network.
"type": "wifi",
"style": "powerline",
"background": "#8822ee",
"foreground": "#eeeeee",
"foreground": "#222222",
"background_templates": [
"{{ if (not .Connected) }}#FF1111{{ end }}"
"{{ if (lt .Signal 60) }}#DDDD11{{ else if (lt .Signal 90) }}#DD6611{{ else }}#11CC11{{ end }}"
],
"powerline_symbol": "\uE0B0",
"properties": {
"template": "{{if .Connectected}}\uFAA8{{else}}\uFAA9{{end}}{{if .Connected}}{{.SSID}} {{.Signal}}% {{.ReceiveRate}}Mbps{{else}}{{.State}}{{end}}"
"template": "{{ if .Connected }}\uFAA8{{ else }}\uFAA9{{ end }}
{{ if .Connected }}{{ .SSID }} {{ .Signal }}% {{ .ReceiveRate }}Mbps{{ else }}{{ .State }}{{ end }}"
}
}
```
## Properties
- connected_icon: `string` - the icon to use when WiFi is connected - defaults to `\uFAA8`
- connected_icon: `string` - the icon to use when WiFi is disconnected - defaults to `\uFAA9`
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig]
utilizing the properties below -
defaults to `{{if .Connectected}}\uFAA8{{else}}\uFAA9{{end}}{{if .Connected}}{{.SSID}} {{.Signal}}% {{.ReceiveRate}}Mbps{{else}}{{.State}}{{end}}`
- template: `string` - A go [text/template][go-text-template] extended with [sprig][sprig] using the properties below
## Template Properties
- `.Connected`: `bool` - if WiFi is currently connected
- `.State`: `string` - WiFi connection status - e.g. connected or disconnected
- `.State`: `string` - WiFi connection status - _e.g. connected or disconnected_
- `.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.
- `.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)

View file

@ -180,7 +180,8 @@
"owm",
"sysinfo",
"angular",
"php"
"php",
"wifi"
]
},
"style": {
@ -1697,6 +1698,26 @@
}
}
}
},
{
"if": {
"properties": {
"type": { "const": "wifi" }
}
},
"then": {
"title": "WiFi Segment",
"description": "https://ohmyposh.dev/docs/wifi",
"properties": {
"properties": {
"properties": {
"template": {
"$ref": "#/definitions/template"
}
}
}
}
}
}
]
}