Single repo + chezmoi status in oh-my-posh prompt

Oh-My-Posh prompt displaying chezmoi status when changes are in working
copy (home dir) and/or uncommitted changes in the source path.

Externals manages as a separate chezmoi source in a subdir of the source
repo.
This commit is contained in:
Gal Szkolnik 2022-09-26 18:39:41 -04:00
parent fed4970b64
commit d6687d8fa4
7 changed files with 110 additions and 8 deletions

View file

@ -287,6 +287,24 @@
"template": "{{ if gt .Code 0 }}{{ .Meaning }}{{ else }}✔{{ end }} ",
"type": "exit"
},
{
"type": "command",
"foreground": "",
"foreground_templates": [
"{{ if eq .Output \"0,0\" }}#DD7700{{else}}#d3d7cf{{ end }}"
],
"background_templates": [
"{{ if eq .Output \"0,0\" }}#000000{{else}}#DD7700{{ end }}"
],
"powerline_symbol": "",
"invert_powerline": true,
"style": "powerline",
"properties": {
"shell": "bash",
"command": "type -t chezmoi 2>&1 >/dev/null && printf \"%s\" $(chezmoi status 2>/dev/null | wc -l) , $(chezmoi git -- status --short | wc -l)"
},
"template": "{{ if ne .Output \"0,0\" }}≢{{ .Output }}{{ end }}"
},
{
"background": "#4063D8",
"background_templates": [