Skip to content

Instantly share code, notes, and snippets.

@trajano
Last active August 25, 2023 05:46
Show Gist options
  • Save trajano/6330ead3e34f8288f72e7eb54779b761 to your computer and use it in GitHub Desktop.
Save trajano/6330ead3e34f8288f72e7eb54779b761 to your computer and use it in GitHub Desktop.
My Oh My Posh settings
---
"$schema": https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version: 2
## Design
## [username] [host if not local] [repo] path >>>> [ project info ] [tool info]
## [status] > [ battery ] [ time?, let me think about it ]
## General idea
## [who and where am I] >>> [ what information do you have about the stuff where I am]
## [ anything really important? ] > [still figuring this out but at least the battery]
## Style
## | ) ( |
## >
#var:
# ShowLocal: "true"
# disable_cursor_positioning: true
palette:
background: "232" #080808
red: "88" #870000
error: "166"
git: "23" #005f5f
git_detached: "160" #005f5f
git_repo: "95" #005f5f
regular: "18" #000087
branch: "226"
prompt: "226"
prompt_transient: "243"
tool_version: "63"
package_version: "66"
package_text: "222"
docker_context: "146"
status_code: "184"
jobs: "93"
jobs_count: "220"
not_me: "230"
session_background: "96"
session_background_root: "88"
os_icon: "230"
os_background: "57"
blocks:
- type: prompt
alignment: left
segments:
# https://ohmyposh.dev/docs/segments/os
# This is actually a hack, I wanted to have a rounded element for whatever the first active one would
# be, but I haven't figured it out yet. So I am using the OS icon for now as a permanent fixture
# - type: os
# style: diamond
# leading_diamond: "๎‚ถ"
# # trailing_diamond: "๎‚ฐ"
# foreground: "p:os_icon"
# background_templates:
# - "{{ if .Root }}p:session_background_root{{end}}"
# - "p:os_background"
# template: "{{ .Icon }} "
- type: shell
style: diamond
leading_diamond: "๎‚ถ"
foreground: "p:os_icon"
background_templates:
- "{{ if .Root }}p:session_background_root{{end}}"
- "p:os_background"
template: "{{ .Name }} "
properties:
mapped_shell_names:
pwsh: ๓ฐจŠ
bash: "๓ฑ†ƒ"
# ๎ฏŠ
fish: ๓ฐˆบ
zsh: ๓ฐฌก
- type: session
style: powerline
#powerline_symbol: "{{.Var.PowerLineSymbolL}}"
powerline_symbol: "๎ƒ†"
background_templates:
- "{{ if .Root }}p:session_background_root{{end}}"
- "p:session_background"
templates:
- " {{ if .SSHSession }}๓ฐขน {{ .UserName }} ๏‡บ {{ .HostName }}{{ end }} "
- " {{ if .Var.ShowLocal }}๏“ฟ {{ .UserName }} ๏‡บ {{ .HostName }}{{ end }} "
templates_logic: first_match
- type: git
style: powerline
#powerline_symbol: "{{.Var.PowerLineSymbolL}}"
powerline_symbol: "๎ƒ†"
foreground: "p:branch"
background: "p:git_repo"
template: "{{if ne .Dir .PWD}} \ue702 {{.RepoName}} {{end}}"
- type: path
# style: diamond
style: powerline
powerline_symbol: "๎ƒ†"
properties:
style: mixed
folder_separator_icon: /
home_icon: ๐Ÿ 
mapped_locations:
"C:/p": ๎œˆ
"C:/dh": ๏€
"~/Desktop": ๓ฑˆน
"~/Downloads": ๓ฐ‡š
"~/p": ๏€
# leading_diamond: "๎‚ฐ"
# leading_diamond: "๎‚ถ"
background: "p:regular"
template: " {{ .Path }} "
- type: git
style: powerline
#powerline_symbol: "{{.Var.PowerLineSymbolL}}"
powerline_symbol: "๎ƒ†"
foreground: "p:branch"
background: "p:git"
template: "{{if ne .Ref \"(detached)\" }} {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }} {{end}}"
properties:
fetch_status: true
commit_icon: "๐Ÿ”—"
- type: text
style: accordion
foreground: "parentBackground"
templates:
- "{{ if .Root}}๎ƒ€{{end}}"
- "๎‚ด"
# - "๎‚ฐ"
templates_logic: first_match
- type: executiontime
style: plain
template: " ๏”  {{ .FormattedMs }}"
properties:
threshold: 2000
style: austin
- type: prompt
alignment: right
overflow: hide
segments:
- type: project
style: diamond
leading_diamond: ๎‚ถ
trailing_diamond: ๎‚ด
invert_powerline: true
foreground: "p:package_text"
background: "p:package_version"
template: "{{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}๏’‡ {{.Version}}{{
end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }}"
- type: java
style: diamond
leading_diamond: ๎‚ถ
trailing_diamond: ๎‚ด
foreground: "p:package_text"
background: "p:tool_version"
template: " ๎œธ {{ .Major }}.{{ .Minor}}"
min_width: 72
- type: go
style: diamond
leading_diamond: ๎‚ถ
trailing_diamond: ๎‚ด
foreground: "p:package_text"
background: "p:tool_version"
template: " ๎˜ง {{ .Major }}.{{ .Minor}}"
min_width: 72
- type: python
style: diamond
leading_diamond: ๎‚ถ
trailing_diamond: ๎‚ด
foreground: "p:package_text"
background: "p:tool_version"
template: " ๎œผ {{ .Major }}.{{ .Minor}}"
min_width: 72
- type: node
style: diamond
leading_diamond: ๎‚ถ
trailing_diamond: ๎‚ด
foreground: "p:package_text"
background: "p:tool_version"
template: " ๎œ˜ {{ .Major }}.{{ .Minor}}"
min_width: 72
- type: docker
style: diamond
leading_diamond: ๎‚ถ
trailing_diamond: ๎‚ด
# foreground: "#000000"
background: "p:session_background"
template: '{{ if ne .Context "desktop-linux" }} ๏Œˆ {{ .Context }} {{end}}'
# - type: time
# style: diamond
# leading_diamond: ๎‚ถ
# trailing_diamond: ๎‚ด
# foreground: "p:os_icon"
# background: "p:os_background"
# properties:
# time_format: '15:04'
# - type: time
# style: plain
# foreground: "p:red"
# properties:
# time_format: '15:04'
- type: rprompt
segments:
- type: battery
"style": "powerline"
"powerline_symbol": "๎‚ฐ"
"foreground": "#193549"
"background": "#ffeb3b"
"background_templates": [
"{{if eq \"Charging\" .State.String}}#40c4ff{{end}}",
"{{if eq \"Discharging\" .State.String}}#ff5722{{end}}",
"{{if eq \"Full\" .State.String}}#4caf50{{end}}"
]
"template": " {{ if and ( not .Error) ( lt .Percentage 50 ) }}{{ .Icon }}{{ .Percentage }}%{{ end }} "
"properties": {
"discharging_icon": "๎ˆฑ ",
"charging_icon": "๎ˆด ",
"charged_icon": "๎ˆฏ "
}
- type: prompt
alignment: left
newline: true
segments:
- type: git
style: diamond
leading_diamond: "\ue0c2\u2800"
trailing_diamond: ๎ƒ€
foreground: "p:branch"
background: "p:git_detached"
template: "{{if eq .Ref \"(detached)\" }} {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }} {{end}}"
properties:
fetch_status: true
commit_icon: "๐Ÿ”—"
- type: prompt
alignment: left
newline: true
segments:
# - type: text
# style: plain
# template: '{{"\u00A0"}}'
# https://ohmyposh.dev/docs/segments/status
- type: status
style: plain
foreground: "p:prompt"
# background: "p:red"
# background_templates:
# - "{{ if .Error }}#e91e63{{ end }}"
# trailing_diamond: "๎‚ด"
template: "โŒ {{ .Code }} "
# properties:
# always_enabled: true
- type: text
style: plain
foreground: "p:prompt"
foreground_templates:
- "{{ if ne .Code 0 }}p:error{{ end }}"
templates:
- "{{ if .Root}}๏“Ÿ{{end}}"
- "โฏ"
templates_logic: first_match
final_space: true
console_title_template: "{{.Folder}}{{if .Root}} :: root{{end}} {{if .Env.SSH_CLIENT}}:: {{ .UserName }} @ {{ .HostName }}{{end}}"
transient_prompt:
background: transparent
foreground: "p:prompt_transient"
template: "{{.Folder}} {{ if .Root}}๏“Ÿ{{else}}โฏ{{end}} "
secondary_prompt:
background: transparent
foreground: "#ffffff"
template: "-> "
# tooltips:
# - type: git
# tips:
# - git
# - g
# style: diamond
# foreground: "#193549"
# background: "#fffb38"
# leading_diamond: ๎‚ถ
# trailing_diamond: ๎‚ด
# template: "{{ .HEAD }}{{ if .Staging.Changed }} ๏† {{ .Staging.String }}{{ end
# }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if
# .Working.Changed }} ๏„ {{ .Working.String }}{{ end }}"
# properties:
# fetch_status: true
# fetch_upstream_icon: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment