Skip to content

Instantly share code, notes, and snippets.

@stamminator
Last active August 1, 2024 18:04
Show Gist options
  • Save stamminator/9be338d5312908bea33c90adafacfc17 to your computer and use it in GitHub Desktop.
Save stamminator/9be338d5312908bea33c90adafacfc17 to your computer and use it in GitHub Desktop.
Oh My Posh theme (jelly)

Custom theme for Oh My Posh. Had to call it something, so I went with "jelly".

jelly-theme-ohmyposh

The red 🛡️ appears when in an elevated prompt (administrator or root).

File paths are not truncated, which allows for easy copy/pasting.

# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
blocks:
- type: prompt
alignment: left
newline: false
segments:
- type: path
style: plain
template: ' {{ .Path }} '
properties:
style: full
foreground: '#61AFEF'
- type: dotnet
style: plain
foreground: "#582BFC"
template: "{{ if and .Major .Minor }} 󰪮 {{ .Major }}.{{ .Minor }}{{ if .Prerelease }}-pre{{ end }} {{ end }}"
- type: node
style: plain
foreground: "#6cc24a"
template: "{{if and .Major .Minor }}  {{ .Major }}.{{ .Minor }} {{ end }}"
- type: git
style: plain
foreground: '#F3C267'
foreground_templates:
- '{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}'
- '{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}'
- '{{ if gt .Ahead 0 }}#B388FF{{ end }}'
- '{{ if gt .Behind 0 }}#B388FF{{ end }}'
properties:
branch_max_length: 25
fetch_stash_count: true
fetch_status: true
fetch_upstream_icon: true
template: ' {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }} '
- type: prompt
alignment: right
newline: false
segments:
- type: executiontime
style: plain
foreground: '#23700E'
- type: time
style: plain
foreground: '#E5C07B'
template: ' {{ .CurrentDate | date .Format }} '
- type: prompt
alignment: left
newline: true
segments:
- type: root
style: powerline
powerline_symbol: ' '
template: '<b>󰻌 </b>'
background: '#A50E0E'
- type: shell
style: plain
foreground: '#CCC618'
properties:
mapped_shell_names:
pwsh: pwsh
powershell: pwsh5
cmd: cmd
bash: bash
template: ' {{ .Name }} '
- type: session
style: plain
foreground: "#475CFF"
template: " {{ .UserName }}{{ if .SSHSession }}@{{ .HostName }}{{ end }} "
- type: text
style: plain
template: ">"
foreground: '#475CFF'
final_space: true
version: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment