Skip to content

Instantly share code, notes, and snippets.

@JeremiePat
Last active June 26, 2023 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeremiePat/0187b33d50011ff69c887631be449e8f to your computer and use it in GitHub Desktop.
Save JeremiePat/0187b33d50011ff69c887631be449e8f to your computer and use it in GitHub Desktop.
My own Oh-My-Posh configuration
---
"$schema": https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
blocks:
- type: prompt
alignment: left
segments:
- type: session
style: diamond
leading_diamond: "\uE0B6"
trailing_diamond: "\uE0B0"
background: "#8c0fa8"
background_templates:
- '{{ if .Root }}#FF0000{{ end }}'
template: "{{ if .Root }}\uf06a {{ end }}{{ .UserName }} "
- type: path
properties:
style: agnoster_short
max_depth: 2
mapped_locations_enabled: true
mapped_locations:
~/Github/: "\uF114 "
style: powerline
powerline_symbol: ""
background: "#2277BB"
template: " {{ .Path }} "
- type: git
properties:
fetch_status: true
branch_max_length: 20
truncate_symbol: "…"
branch_icon: "\ue725 "
commit_icon: "\uF417 "
style: powerline
powerline_symbol: ""
foreground: "#FFFFFF"
foreground_templates:
- "{{ if or (.Working.Changed) (.Staging.Changed) }}#000000{{ end }}"
- "{{ if or (gt .Ahead 0) (gt .Behind 0) }}#FFFFFF{{ end }}"
background: "#005500"
background_templates:
- "{{ if or (.Working.Changed) (.Staging.Changed) }}#CCCCCC{{ end }}"
- "{{ if or (gt .Ahead 0) (gt .Behind 0) }}#CC33AA{{ end }}"
template: " {{ .HEAD -}}
{{- if or (.Staging.Changed) (.Working.Changed) }}{{ else -}}
{{- if gt .StashCount 0 }} (\uea98 {{ .StashCount }}){{ end -}}
{{- end }}
{{- if .Working.Changed -}}
{{- \" <#FF0000><b>\" -}}
{{- if gt .Working.Added 0 }}+{{ end -}}
{{- if gt .Working.Modified 0 }}~{{ end -}}
{{- if gt .Working.Deleted 0 }}-{{ end -}}
{{- if gt .Working.Untracked 0}}?{{ end -}}
{{- \"</b></>\" -}}
{{- end -}}
{{- if and (.Staging.Changed) (.Working.Changed) }} 󱦰{{ end -}}
{{- if .Staging.Changed -}}
{{- \" <#FF0000><b>\" -}}
{{- if gt .Staging.Added 0 }}+{{ end -}}
{{- if gt .Staging.Modified 0 }}~{{ end -}}
{{- if gt .Staging.Deleted 0 }}-{{ end -}}
{{- if gt .Staging.Untracked 0}}?{{ end -}}
{{- \"</b></>\" -}}
{{- end }} "
- type: prompt
alignment: right
filler: "<#333333,transparent></>"
overflow: hide
background: transparent
segments:
- type: upgrade
style: diamond
trailing_diamond: "\uE0B4"
leading_diamond: "\uE0B6"
foreground: "#111111"
background: "#FFD664"
template: "<i>Update available \uf019 "
- type: time
properties:
time_format: '15:04'
style: diamond
trailing_diamond: "\uE0C0 "
leading_diamond: "\uE0B2"
foreground: "#000000"
background: "#FFDD00"
template: " {{ .CurrentDate | date .Format }} "
- type: node
style: diamond
trailing_diamond: "\uE0B4"
foreground: '#000000'
background: '#BBFF99'
template: " {{ .Full }}{{ if and .Mismatch .Expected }} (<i>{{ .Expected }}</i>){{ end }}"
- type: npm
style: diamond
trailing_diamond: "\uE0B4"
foreground: '#000000'
background: '#BBFF99'
template: " {{ .Full }}"
# - type: deno
# style: diamond
# trailing_diamond: "\uE0B4"
# foreground: "#000000"
# background: "#99FFFF"
# template: " 󰯵 {{ .Full }}"
- type: battery
style: diamond
trailing_diamond: "\uE0B4"
foreground: "#000000"
background: "#006600"
background_templates:
- '{{if gt .Percentage 88}}#00DD00{{end}}'
- '{{if gt .Percentage 77}}#44EE22{{end}}'
- '{{if gt .Percentage 66}}#88FF22{{end}}'
- '{{if gt .Percentage 55}}#CCFF22{{end}}'
- '{{if gt .Percentage 44}}#FFFF22{{end}}'
- '{{if gt .Percentage 33}}#FFCC22{{end}}'
- '{{if gt .Percentage 22}}#FF8822{{end}}'
- '{{if gt .Percentage 11}}#EE4422{{end}}'
- '{{if gt .Percentage 0}}#DD0022{{end}}'
template: "{{- if not .Error -}}
{{- if eq \"Charging\" .State.String -}}
{{- if .Icon }} {{ .Icon }}{{ end -}}
{{- else -}}
{{- if gt .Percentage 90 }}{{ \" 󰁹 \" -}}
{{- else if gt .Percentage 80 }}{{ \" 󰂂 \" -}}
{{- else if gt .Percentage 70 }}{{ \" 󰂁 \" -}}
{{- else if gt .Percentage 60 }}{{ \" 󰂀 \" -}}
{{- else if gt .Percentage 50 }}{{ \" 󰁿 \" -}}
{{- else if gt .Percentage 40 }}{{ \" 󰁾 \" -}}
{{- else if gt .Percentage 30 }}{{ \" 󰁽 \" -}}
{{- else if gt .Percentage 20 }}{{ \" 󰁼 \" -}}
{{- else if gt .Percentage 10 }}{{ \" 󰁻 \" -}}
{{- else if gt .Percentage 0 }}{{ \" 󰁺 \" -}}{{ end -}}
{{- end -}}
{{- .Percentage }}%{{ end }}"
properties:
charging_icon: "󰂄 "
- type: prompt
alignment: left
newline: true
segments:
- type: text
background: transparent
foreground: "#FFFFFF"
template: "\uE691"
transient_prompt:
background: transparent
foreground: "#FFFFFF"
template: "\uE691 "
secondary_prompt:
background: transparent
foreground: "#FFFFFF"
template: "\uE691 "
final_space: true
version: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment