From 7a108d54463d53de672a0abc6471697203b72cd9 Mon Sep 17 00:00:00 2001 From: Anthony Oteri <4360016+anthonyoteri@users.noreply.github.com> Date: Fri, 12 Sep 2025 08:02:37 -0400 Subject: [PATCH] feat: swap prompts to oh-my-posh --- .config/ohmyposh/omp.toml | 165 ++++++++++++++++++++++++++++++++++++++ .zshrc | 6 +- 2 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 .config/ohmyposh/omp.toml diff --git a/.config/ohmyposh/omp.toml b/.config/ohmyposh/omp.toml new file mode 100644 index 0000000..6a6c626 --- /dev/null +++ b/.config/ohmyposh/omp.toml @@ -0,0 +1,165 @@ +console_title_template = '{{ .Shell }} in {{ .Folder }}' +version = 3 +final_space = true + +[palette] + black = '#262B44' + blue = '#4B95E9' + green = '#59C9A5' + orange = '#F07623' + red = '#D81E5B' + white = '#E0DEF4' + yellow = '#F3AE35' + +[secondary_prompt] + template = '<,p:yellow> >  ' + foreground = 'p:black' + background = 'transparent' + +[transient_prompt] + template = '<,p:yellow> {{ .Folder }}  ' + foreground = 'p:black' + background = 'transparent' + +[upgrade] + source = 'cdn' + interval = '168h' + auto = false + notice = false + +[[blocks]] + type = 'prompt' + alignment = 'left' + + [[blocks.segments]] + leading_diamond = '' + trailing_diamond = '' + template = ' {{ if .SSHSession }} {{ end }}{{ .UserName }} ' + foreground = 'p:black' + background = 'p:yellow' + type = 'session' + style = 'diamond' + + [[blocks.segments]] + template = '  {{ path .Path .Location }} ' + foreground = 'p:white' + powerline_symbol = '' + background = 'p:orange' + type = 'path' + style = 'powerline' + + [blocks.segments.properties] + style = 'folder' + + [[blocks.segments]] + template = ' {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }} ' + foreground = 'p:black' + powerline_symbol = '' + background = 'p:green' + type = 'git' + style = 'powerline' + foreground_templates = ['{{ if or (.Working.Changed) (.Staging.Changed) }}p:black{{ end }}', '{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:white{{ end }}', '{{ if gt .Ahead 0 }}p:white{{ end }}'] + background_templates = ['{{ if or (.Working.Changed) (.Staging.Changed) }}p:yellow{{ end }}', '{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:red{{ end }}', '{{ if gt .Ahead 0 }}#49416D{{ end }}', '{{ if gt .Behind 0 }}#7A306C{{ end }}'] + + [blocks.segments.properties] + branch_template = '{{ trunc 25 .Branch }}' + fetch_status = true + fetch_upstream_icon = true + + [[blocks.segments]] + template = '  ' + foreground = 'p:white' + powerline_symbol = '' + background = 'p:yellow' + type = 'root' + style = 'powerline' + + [[blocks.segments]] + leading_diamond = '' + trailing_diamond = '' + template = ' {{ if gt .Code 0 }}{{ else }}{{ end }} ' + foreground = 'p:white' + background = 'p:blue' + type = 'status' + style = 'diamond' + background_templates = ['{{ if gt .Code 0 }}p:red{{ end }}'] + + [blocks.segments.properties] + always_enabled = true + +[[blocks]] + type = 'rprompt' + + [[blocks.segments]] + template = ' ' + foreground = 'p:green' + background = 'transparent' + type = 'node' + style = 'plain' + + [blocks.segments.properties] + display_mode = 'files' + fetch_package_manager = false + home_enabled = false + + [[blocks.segments]] + template = ' ' + foreground = 'p:blue' + background = 'transparent' + type = 'go' + style = 'plain' + + [blocks.segments.properties] + fetch_version = false + + [[blocks.segments]] + template = ' ' + foreground = 'p:yellow' + background = 'transparent' + type = 'python' + style = 'plain' + + [blocks.segments.properties] + display_mode = 'files' + fetch_version = false + fetch_virtual_env = false + + [[blocks.segments]] + template = 'in {{ .Name }} ' + foreground = 'p:white' + background = 'transparent' + type = 'shell' + style = 'plain' + + [[blocks.segments]] + template = 'at {{ .CurrentDate | date "15:04:05" }}' + foreground = 'p:white' + background = 'transparent' + type = 'time' + style = 'plain' + +[[tooltips]] + leading_diamond = '' + trailing_diamond = '' + template = '  {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ' + foreground = 'p:white' + background = 'p:orange' + type = 'aws' + style = 'diamond' + tips = ['aws'] + + [tooltips.properties] + display_default = true + +[[tooltips]] + leading_diamond = '' + trailing_diamond = '' + template = '  {{ .Name }} ' + foreground = 'p:white' + background = 'p:blue' + type = 'az' + style = 'diamond' + tips = ['az'] + + [tooltips.properties] + display_default = true diff --git a/.zshrc b/.zshrc index f4958a8..2fb465a 100644 --- a/.zshrc +++ b/.zshrc @@ -54,8 +54,10 @@ autoload -U compinit && compinit zinit cdreplay -q -# Add Starship prompt -eval "$(starship init zsh)" +# Add in Oh-My-Posh Prompt +if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then + eval "$(oh-my-posh init zsh --config ${HOME}/.config/ohmyposh/omp.toml)" +fi # History HISTSIZE=5000