From 5c9e6eef74511165ab3947dd4349c25139917af0 Mon Sep 17 00:00:00 2001 From: gwbeip Date: Thu, 24 Apr 2025 15:46:56 +0800 Subject: [PATCH] add the config file for Oh-My-Posh in pwsh --- pwsh/HowToUse.txt | 2 + pwsh/powerlevel10k_rainbow_eip.omp.json | 220 ++++++++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 pwsh/HowToUse.txt create mode 100644 pwsh/powerlevel10k_rainbow_eip.omp.json diff --git a/pwsh/HowToUse.txt b/pwsh/HowToUse.txt new file mode 100644 index 0000000..549488f --- /dev/null +++ b/pwsh/HowToUse.txt @@ -0,0 +1,2 @@ +Copy *.omp.json to `$env:POSH_THEMES_PATH` +Edit $PROFILE and add `oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/powerlevel10k_rainbow_eip.omp.json" | Invoke-Expression` at the top. diff --git a/pwsh/powerlevel10k_rainbow_eip.omp.json b/pwsh/powerlevel10k_rainbow_eip.omp.json new file mode 100644 index 0000000..ad54c32 --- /dev/null +++ b/pwsh/powerlevel10k_rainbow_eip.omp.json @@ -0,0 +1,220 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "blocks": [ + { + "alignment": "left", + "segments": [ + { + "background": "#d3d7cf", + "foreground": "#000000", + "style": "accordion", + "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} ", + "type": "os" + }, + { + "background": "#3465a4", + "foreground": "#e4e4e4", + "powerline_symbol": "\ue0b0", + "properties": { + "home_icon": "~", + "style": "full" + }, + "style": "powerline", + "template": " \uf07c {{ .Path }} ", + "type": "path" + }, + { + "background": "#4e9a06", + "background_templates": [ + "{{ if or (.Working.Changed) (.Staging.Changed) }}#c4a000{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", + "{{ if gt .Behind 0 }}#4e9a06{{ end }}" + ], + "foreground": "#000000", + "powerline_symbol": "\ue0b0", + "properties": { + "branch_icon": "\uf126 ", + "fetch_stash_count": true, + "fetch_status": true, + "fetch_upstream_icon": true + }, + "style": "powerline", + "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ", + "type": "git" + } + ], + "type": "prompt" + }, + { + "alignment": "right", + "segments": [ + { + "background": "#689f63", + "foreground": "#ffffff", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "fetch_version": true + }, + "style": "powerline", + "template": " {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} \ue718 ", + "type": "node" + }, + { + "background": "#00acd7", + "foreground": "#111111", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "fetch_version": true + }, + "style": "powerline", + "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} \ue627 ", + "type": "go" + }, + { + "background": "#4063D8", + "foreground": "#111111", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "fetch_version": true + }, + "style": "powerline", + "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} \ue624 ", + "type": "julia" + }, + { + "background": "#FFDE57", + "foreground": "#111111", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "display_mode": "files", + "fetch_virtual_env": false + }, + "style": "powerline", + "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} \ue235 ", + "type": "python" + }, + { + "background": "#AE1401", + "foreground": "#ffffff", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "display_mode": "files", + "fetch_version": true + }, + "style": "powerline", + "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} \ue791 ", + "type": "ruby" + }, + { + "background": "#FEAC19", + "foreground": "#ffffff", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "display_mode": "files", + "fetch_version": false + }, + "style": "powerline", + "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} \uf0e7", + "type": "azfunc" + }, + { + "background_templates": [ + "{{if contains \"default\" .Profile}}#FFA400{{end}}", + "{{if contains \"jan\" .Profile}}#f1184c{{end}}" + ], + "foreground": "#ffffff", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "display_default": false + }, + "style": "powerline", + "template": " {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} \ue7ad ", + "type": "aws" + }, + { + "background": "#ffff66", + "foreground": "#111111", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "style": "powerline", + "template": " \uf0ad ", + "type": "root" + }, + { + "background": "#c4a000", + "foreground": "#000000", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "style": "powerline", + "template": " {{ .FormattedMs }} \uf252 ", + "type": "executiontime", + "properties": { + "threshold": 1, + "style": "roundrock", + "always_enabled": false + } + }, + { + "background": "#000000", + "background_templates": [ + "{{ if gt .Code 0 }}#cc2222{{ end }}" + ], + "foreground": "#d3d7cf", + "invert_powerline": true, + "powerline_symbol": "\ue0b2", + "properties": { + "always_enabled": true + }, + "style": "powerline", + "template": " {{ if gt .Code 0 }}{{ reason .Code }}{{ else }}\uf42e{{ end }} ", + "type": "status" + }, + { + "background": "#d3d7cf", + "foreground": "#000000", + "invert_powerline": true, + "style": "accordion", + "template": " {{ .CurrentDate | date .Format }} \uf017 ", + "trailing_diamond": "\ue0b0", + "type": "time" + } + ], + "type": "prompt" + }, + { + "alignment": "left", + "newline": true, + "segments": [ + { + "foreground": "#d3d7cf", + "style": "plain", + "template": "\u276f", + "type": "text" + } + ], + "type": "prompt" + }, + { + "segments": [ + { + "foreground": "#d3d7cf", + "style": "plain", + "template": "", + "type": "text" + } + ], + "type": "rprompt" + } + ], + "console_title_template": "{{ .Shell }} in {{ .Folder }}", + "final_space": true, + "version": 3 +} \ No newline at end of file