mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 19:39:39 -08:00
f47da9592f
BREAKING CHANGE: exit segment is now called status segment. The exit keyword is now deprecated and will be removed in a future release. Please use the status keyword instead: ```diff "segments": { { - "type": "exit" + "type": "status" } } ``` Additionally, the status segment configuration has changed to support $PIPESTATUS. You can include a status template to customize the rendering of each individual status code (supported in fish, zsh and bash). ```json "segments": { { "type": "status", "properties": { "status_template": "{{ if gt .Code 0 }}\uf071{{ else }}\uf00c{{ end }}", "status_separator": " " } } } ``` In case no $PIPESTATUS is available, the status segment will fall back to the exit code of the last command using the status template for rendering. The `{{ .Meaning }}` property has been marked as deprecated and can be replaced with `{{ reason .Code }}`, allowing it to be reused in cross segment templates. resolves #4070
189 lines
6.1 KiB
JSON
189 lines
6.1 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
|
"version": 2,
|
|
"console_title_template": "{{ if or .Root .Segments.Git.RepoName }}[ {{ if .Root }}Admin{{ end }}{{ if and .Root .Segments.Git.RepoName }}@{{ end }}{{ if .Segments.Git.RepoName }}{{ .Segments.Git.RepoName }}{{ end }} ]{{ end }} {{ .Folder }}",
|
|
"palette": {
|
|
"background-color": "transparent",
|
|
"cloud-text-amazon": "#4285F4",
|
|
"cloud-text-azure": "#4285F4",
|
|
"cloud-text-gcp": "#4285F4",
|
|
"error-background": "#dd0033",
|
|
"error-text": "#242424",
|
|
"git-text": "#238636",
|
|
"kubernetes-text": "#FFBB00",
|
|
"symbol-color": "#ffffff",
|
|
"timer-text": "#dd0033"
|
|
},
|
|
"blocks": [
|
|
{
|
|
"alignment": "left",
|
|
"newline": false,
|
|
"segments": [
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:timer-text",
|
|
"properties": {
|
|
"time_format": "15:04:05"
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "",
|
|
"template": " <p:symbol-color>\uebaa</> {{ dateInZone .Format .CurrentDate \"UTC\" }} ",
|
|
"type": "time"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:kubernetes-text",
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": "<p:symbol-color>\uf308</> {{.Context}}{{if .Namespace}} \uf061 {{.Namespace}}{{end}}",
|
|
"type": "kubectl"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:cloud-text-amazon",
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": " <p:symbol-color>\uf270</> {{.Profile}}{{if .Region}} \uf061 {{.Region}}{{end}}",
|
|
"type": "aws"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:cloud-text-azure",
|
|
"properties": {
|
|
"source": "cli"
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": " <p:symbol-color>\uebd8</> {{ .Name }}",
|
|
"type": "az"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:cloud-text-azure",
|
|
"properties": {
|
|
"source": "pwsh"
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": " <p:symbol-color>\uebd8</> (PS) {{ .Name }}",
|
|
"type": "az"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:cloud-text-gcp",
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": " <p:symbol-color>\ue7b2</> {{ .Project }}",
|
|
"type": "gcp"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:git-text",
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": " <p:symbol-color>\uF408</> {{ .RepoName }}",
|
|
"type": "git"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:timer-text",
|
|
"properties": {
|
|
"style": "austin",
|
|
"threshold": 1
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": " <p:symbol-color>\ueba2</> {{ .FormattedMs }}",
|
|
"type": "executiontime"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:symbol-color",
|
|
"properties": {
|
|
"always_enabled": true
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": "{{ if eq .Code 0 }} \uf004 {{ end }}",
|
|
"type": "status"
|
|
},
|
|
{
|
|
"background": "p:error-background",
|
|
"foreground": "p:error-text",
|
|
"leading_diamond": " \ue0c5",
|
|
"trailing_diamond": "\ue0c4",
|
|
"style": "diamond",
|
|
"template": "{{ if ne .Code 0 }} \uf00d {{ .Code }}{{ if (ne (reason .Code) (toString .Code)) }} - {{ reason .Code }}{{else}}{{ end }} {{ end }}",
|
|
"type": "status"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
},
|
|
{
|
|
"alignment": "left",
|
|
"newline": true,
|
|
"segments": [
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:timer-text",
|
|
"properties": {
|
|
"time_format": "15:04:05"
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "",
|
|
"template": " <p:symbol-color>\uf49b</> {{ .CurrentDate | date .Format }} ",
|
|
"type": "time"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:symbol-color",
|
|
"properties": {
|
|
"folder_separator_icon": "/",
|
|
"style": "folder"
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": "\ue5ff {{ path .Path .Location }} ",
|
|
"type": "path"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:git-text",
|
|
"properties": {
|
|
"fetch_stash_count": true,
|
|
"fetch_status": true
|
|
},
|
|
"style": "powerline",
|
|
"powerline_symbol": "\ue0b4",
|
|
"template": "{{ .HEAD }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
|
|
"type": "git"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
},
|
|
{
|
|
"alignment": "left",
|
|
"newline": true,
|
|
"segments": [
|
|
{
|
|
"background": "p:error-background",
|
|
"foreground": "p:backgrond-color",
|
|
"style": "diamond",
|
|
"leading_diamond": "\ue0c7",
|
|
"trailing_diamond": "\ue0c6",
|
|
"template": " \uf0e7 ",
|
|
"type": "root"
|
|
},
|
|
{
|
|
"background": "p:background-color",
|
|
"foreground": "p:git-text",
|
|
"style": "plain",
|
|
"template": "{{ if .Root }}{{ else }}<p:symbol-color> > </>{{ end }}",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"type": "prompt"
|
|
}
|
|
]
|
|
}
|