From 3e24889f02eaf7d8048767f36ea2d6a287510361 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Tue, 7 May 2024 13:46:49 +0800 Subject: [PATCH 01/13] fix(package): cmd mis-interpretation + cmd name clarification --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a533960..f2de8a9 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.2.0", "description": "Non-Standard Compliant Material Design-Inspired Chips Theme for Oh-My-Posh Theme.", "scripts": { - "copy-local": "pwsh -NoProfile -Command Copy-Item -Destination \"./\" -Path \"~/chips.omp.json\" -Confirm", - "copy-local-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"./chips-double-width.omp.json\" -Path \"~/chips.omp.json\" -Confirm", - "copy-git": "pwsh -NoProfile -Command Copy-Item -Destination \"~/\" -Path \"chips.omp.json\" -Confirm", - "copy-git-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"~/chips.omp.json\" -Path \"chips-double-width.omp.json\" -Confirm", + "copy-to-local": "pwsh -NoProfile -Command Copy-Item -Destination \"./\" -Path \"~/chips.omp.json\" -Confirm", + "copy-to-local-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"~/chips.omp.json\" -Path \"chips-double-width.omp.json\" -Confirm", + "copy-to-git": "pwsh -NoProfile -Command Copy-Item -Destination \"~/\" -Path \"chips.omp.json\" -Confirm", + "copy-to-git-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"chips-double-width.omp.json\" -Path \"~/chips.omp.json\" -Confirm", "snapshot-local-ref": "pwsh -Command Write-Host \"oh-my-posh config export image --author 'CodexLink, More Samples at https://github.com/CodexLink/chips.omp.json' --config ~/chips.omp.json --cursor-padding 20 --rprompt-offset 20 --output highlight.png\"", "snapshot-remote": "oh-my-posh config export image --author 'CodexLink, More Samples at https://github.com/CodexLink/chips.omp.json' --config chips.omp.json --cursor-padding 20 --rprompt-offset 20 --output assets\\highlight_temp.png" }, From 430846827b6557c090680346eb9b9e7bd2e542ed Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Tue, 7 May 2024 13:48:32 +0800 Subject: [PATCH 02/13] feat(git): display `invalid-git-dir` on folders with invalid `.git` folder, closes #11 --- chips-double-width.omp.json | 2 +- chips.omp.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index 57e4a65..9a936ed 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -37,7 +37,7 @@ "foreground": "p:c-badge-text", "leading_diamond": " \uE0B6", "style": "diamond", - "template": "{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", "properties": { "branch_icon": "\uE725 ", "branch_ahead_icon": " \uE621 \uF0A9 ", diff --git a/chips.omp.json b/chips.omp.json index 0e4b715..6d37f92 100644 --- a/chips.omp.json +++ b/chips.omp.json @@ -37,7 +37,7 @@ "foreground": "p:c-badge-text", "leading_diamond": " \uE0B6", "style": "diamond", - "template": "{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", "properties": { "branch_icon": "\uE0A0 ", "branch_ahead_icon": " \uE621 \uF9AC ", From ca6ee6e5edd98289a7fddb3bdec52c2be70d2294 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 15:16:52 +0800 Subject: [PATCH 03/13] chore(wakatime): remove defined properties, used defaults instead --- chips-double-width.omp.json | 5 ----- chips.omp.json | 5 ----- 2 files changed, 10 deletions(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index 9a936ed..b443729 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -84,11 +84,6 @@ ], "foreground": "p:c-badge-text", "leading_diamond": "\uE0B6", - "properties": { - "url": "https://wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key={{ .Env.WAKATIME_API_KEY }}", - "http_timeout": 2000, - "cache_timeout": 5 - }, "style": "diamond", "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", "trailing_diamond": "\uE0B4 ", diff --git a/chips.omp.json b/chips.omp.json index 6d37f92..4dff094 100644 --- a/chips.omp.json +++ b/chips.omp.json @@ -84,11 +84,6 @@ ], "foreground": "p:c-badge-text", "leading_diamond": "\uE0B6", - "properties": { - "url": "https://wakatime.com/api/v1/users/current/summaries?start=today&end=today&api_key={{ .Env.WAKATIME_API_KEY }}", - "http_timeout": 2000, - "cache_timeout": 5 - }, "style": "diamond", "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", "trailing_diamond": "\uE0B4 ", From 1cf3989180c188e99758b42ce99fc45c75e39c18 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 15:22:30 +0800 Subject: [PATCH 04/13] feat(legacy): introduce `legacy` variants for outdated fonts before nerd-fonts v3 Glyphs issue related to https://github.com/ryanoasis/nerd-fonts/issues/1190. --- chips-double-width-legacy-font.omp.json | 294 ++++++++++++++++++++++++ chips-legacy-font.omp.json | 294 ++++++++++++++++++++++++ 2 files changed, 588 insertions(+) create mode 100644 chips-double-width-legacy-font.omp.json create mode 100644 chips-legacy-font.omp.json diff --git a/chips-double-width-legacy-font.omp.json b/chips-double-width-legacy-font.omp.json new file mode 100644 index 0000000..b443729 --- /dev/null +++ b/chips-double-width-legacy-font.omp.json @@ -0,0 +1,294 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "blocks": [ + { + "alignment": "left", + "segments": [ + { + "background_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_BG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_BG }}{{ else }}p:c-badge-folder{{ end }}" + ], + "foreground_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_FG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_FG }}{{ else }}p:c-badge-text{{ end }}" + ], + "leading_diamond": "\uE0B6", + "properties": { + "style": "agnoster_short", + "folder_separator_icon": "/", + "hide_root_location": true, + "max_depth": 2 + }, + "style": "diamond", + "template": "\uF07B {{ .Path }}", + "trailing_diamond": "\uE0B4", + "type": "path" + }, + { + "background": "p:c-git-normal", + "background_templates": [ + "{{ if gt .Ahead 0 }}p:c-git-ahead{{ end }}", + "{{ if gt .Behind 0 }}p:c-git-behind{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:c-git-ahead-behind{{ end }}", + "{{ if and (not .Working.Changed) (.Staging.Changed) }}p:c-git-staging{{ end }}", + "{{ if and (.Working.Changed) (.Staging.Changed) }}p:c-git-staging-working{{ end }}", + "{{ if .UpstreamGone }}p:c-git-upstream-gone{{ end }}", + "{{ if and (.Working.Changed) (not .Staging.Changed) }}p:c-git-working{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": " \uE0B6", + "style": "diamond", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "properties": { + "branch_icon": "\uE725 ", + "branch_ahead_icon": " \uE621 \uF0A9 ", + "branch_behind_icon": " \uE621 \uF0A8 ", + "branch_gone_icon": " \uE621 \uF00D ", + "branch_identical_icon": " \uE621 \uF00C ", + "fetch_status": true, + "fetch_stash_count": true + }, + "trailing_diamond": "\uE0B4", + "type": "git" + } + ], + "type": "prompt" + }, + { + "alignment": "right", + "segments": [ + { + "background_templates": [ + "{{ if lt .Ms 60000 }}p:c-exec-fast{{ end }}", + "{{ if lt .Ms 3600000 }}p:c-exec-normal{{ end }}", + "{{ if lt .Ms 10800000 }}p:c-exec-slow{{ end }}", + "{{ if ge .Ms 10800000 }}p:c-exec-slower{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "properties": { + "style": "austin", + "threshold": 1 + }, + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\uFA1E {{ .FormattedMs }}.{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "executiontime" + }, + { + "background_templates": [ + "{{ if lt .CumulativeTotal.Seconds 3600 }}p:c-wakatime-undertime{{ end }}", + "{{ if lt .CumulativeTotal.Seconds 10800 }}p:c-wakatime-warm-up{{ end }}", + "{{ if lt .CumulativeTotal.Seconds 25200 }}p:c-wakatime-working{{ end }}", + "{{ if lt .CumulativeTotal.Seconds 28000 }}p:c-wakatime-quota{{ end }}", + "{{ if ge .CumulativeTotal.Seconds 28800 }}p:c-wakatime-overtime{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "wakatime" + }, + { + "background_templates": [ + "{{ if regexMatch \"(^(0[6-9])|(1[0-1])):\" (.CurrentDate | date .Format) }}p:c-date-time-morning{{ end }}", + "{{ if regexMatch (\"(^1[2-4]):\") (.CurrentDate | date .Format) }}p:c-date-time-noon{{ end }}", + "{{ if regexMatch (\"(^1[5-7]):\") (.CurrentDate | date .Format) }}p:c-date-time-afternoon{{ end }}", + "{{ if regexMatch \"(^(1[8-9])|(2[0-3])):\" (.CurrentDate | date .Format) }}p:c-date-time-evening{{ end }}", + "{{ if regexMatch \"^(0[0-5]):\" (.CurrentDate | date .Format) }}p:c-date-time-night{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "properties": { + "time_format": "15:04 (01/02)" + }, + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uF017 {{ .CurrentDate | date .Format }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "time" + }, + { + "background_templates": [ + "{{ if .Error }}p:c-battery-state-error{{ end }}", + "{{ if le .Percentage 15 }}p:c-battery-15-less{{ end }}", + "{{ if and (ge .Percentage 16) (le .Percentage 30) }}p:c-battery-30-less{{ end }}", + "{{ if and (ge .Percentage 31) (le .Percentage 45) }}p:c-battery-45-less{{ end }}", + "{{ if and (ge .Percentage 46) (le .Percentage 55) }}p:c-battery-55-less{{ end }}", + "{{ if and (ge .Percentage 56) (le .Percentage 70) }}p:c-battery-70-less{{ end }}", + "{{ if and (ge .Percentage 71) (le .Percentage 90) }}p:c-battery-90-less{{ end }}", + "{{ if and (ge .Percentage 91) (le .Percentage 100) }}p:c-battery-100-less{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"True\" (title (default \"False\" .Env.DISABLE_SEGMENT_BATTERY)) }}{{ else }}{{ if not .Error }}{{ if eq \"Charging\" .State.String }}\uF0E7 {{ else if eq \"Discharging\" .State.String }}{{ else if eq \"Full\" .State.String }}~ {{ else }}? {{ end }}{{ if le .Percentage 15 }}\uF579{{ else if and (ge .Percentage 16) (le .Percentage 30) }}\uF57A{{ else if and (ge .Percentage 31) (le .Percentage 45) }}\uF57C{{ else if and (ge .Percentage 46) (le .Percentage 55)}}\uF57D{{ else if and (ge .Percentage 56) (le .Percentage 70) }}\uF57E{{ else if and (ge .Percentage 71) (le .Percentage 80) }}\uF580{{ else if and (ge .Percentage 81) (le .Percentage 95) }}\uF581{{ else }}\uF578{{ end }} {{ .Percentage }}%{{ else }}!{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4", + "type": "battery" + } + ], + "type": "prompt" + }, + { + "alignment": "left", + "newline": true, + "segments": [ + { + "template": "{{ if false }}{{ end }}", + "type": "session", + "style": "diamond" + }, + { + "background_templates": [ + "{{ if and (.Segments.Session.SSHSession) (not .Root) }}p:c-shell-state-ssh-active{{ end }}", + "{{ if and (not .Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-active{{ end }}", + "{{ if and (.Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-ssh-active{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if or (.Segments.Session.SSHSession) (.Root) }}{{ if .Segments.Session.SSHSession }}\uE7A2 SSH{{ end }}{{ if and (.Segments.Session.SSHSession) (.Root) }} \uE621 {{ end }}{{ if .Root }}# Root{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "text" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-crystal{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_CRYSTAL)) }}\uE62F {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "crystal" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-flutter{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_FLUTTER)) }}Flutter | {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "dart" + }, + { + "background_templates": [ + "{{ if .Error }}p:c-project-generic-error{{ else }}p:c-project-lua{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_LUA)) }}\uE620 {{ if or (.Error) (empty .Full) }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "lua" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-node{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_NODE)) }}\uE718 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "node" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-rust{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_RUST)) }}\uE7A8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "rust" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-python{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "properties": { + "display_mode": "context" + }, + "style": "diamond", + "template": "{{ if or (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}\uE235 {{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON)) }}{{ .Full }}{{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }} \uE621 {{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}{{ if .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ else }}{{ .Venv }}{{ end }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "python" + }, + { + "style": "plain", + "foreground_templates": [ + "{{ if eq \"False\" (title (default \"False\" .Env.ENABLE_ARROW_DIVIDER_COLOR_EXECUTION_RETURN)) }}p:c-badge-white{{ else }}{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}{{ end }}" + ], + "template": "\u276F", + "type": "text" + } + ], + "type": "prompt" + } + ], + "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", + "final_space": true, + "palette": { + "c-badge-folder": "#FFD770", + "c-badge-text": "#212121", + "c-badge-white": "#FAFAFA", + "c-badge-return-custom": "#E7B9FF", + "c-badge-return-fail-term": "#FF8A80", + "c-badge-return-success": "#B2FF59", + "c-battery-15-less": "#FF8A80", + "c-battery-30-less": "#FFD180", + "c-battery-45-less": "#FFE57F", + "c-battery-55-less": "#FFFF8D", + "c-battery-70-less": "#F4FF81", + "c-battery-90-less": "#B9F6CA", + "c-battery-100-less": "#CCFF90", + "c-battery-state-error": "#FF867F", + "c-date-time-morning": "#FFFF8D", + "c-date-time-noon": "#FFF64F", + "c-date-time-afternoon": "#FFC400", + "c-date-time-evening": "#C0CFFF", + "c-date-time-night": "#83B9FF", + "c-exec-fast": "#C6FF00", + "c-exec-normal": "#FFFF00", + "c-exec-slow": "#FFD180", + "c-exec-slower": "#FF867F", + "c-git-ahead": "#6EFFFF", + "c-git-behind": "#FFA06D", + "c-git-ahead-behind": "#C0CFFF", + "c-git-normal": "#66FFA6", + "c-git-staging": "#FFD740", + "c-git-staging-working": "#FFB2FF", + "c-git-upstream-gone": "#FF867F", + "c-git-working": "#84FFFF", + "c-project-generic-error": "#FF867F", + "c-project-crystal": "#FFFFFF", + "c-project-flutter": "#6DC2FF", + "c-project-lua": "#BBC2FF", + "c-project-node": "#9CFF57", + "c-project-rust": "#FFAB40", + "c-project-python": "#FFE873", + "c-secondary-ellipsis": "#FFFF8D", + "c-shell-state-ssh-active": "#BAFFFF", + "c-shell-state-root-active": "#9FFFE0", + "c-shell-state-root-ssh-active": "#FFB2FF", + "c-wakatime-undertime": "#A7FFEB", + "c-wakatime-warm-up": "#FFFFB3", + "c-wakatime-working": "#FFD180", + "c-wakatime-quota": "#FFD0B0", + "c-wakatime-overtime": "#FF8A80" + }, + "transient_prompt": { + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B6\uF55D \uE0B1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\uFA1E {{ .Segments.Executiontime.FormattedMs }} \uE621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B4 {{ end }}\u276F " + }, + "secondary_prompt": { + "background": "transparent", + "foreground": "p:c-secondary-ellipsis", + "template": " ... " + }, + "version": 2 +} diff --git a/chips-legacy-font.omp.json b/chips-legacy-font.omp.json new file mode 100644 index 0000000..4dff094 --- /dev/null +++ b/chips-legacy-font.omp.json @@ -0,0 +1,294 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "blocks": [ + { + "alignment": "left", + "segments": [ + { + "background_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_BG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_BG }}{{ else }}p:c-badge-folder{{ end }}" + ], + "foreground_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_FG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_FG }}{{ else }}p:c-badge-text{{ end }}" + ], + "leading_diamond": "\uE0B6", + "properties": { + "style": "agnoster_short", + "folder_separator_icon": "/", + "hide_root_location": true, + "max_depth": 2 + }, + "style": "diamond", + "template": "\uF07B {{ .Path }}", + "trailing_diamond": "\uE0B4", + "type": "path" + }, + { + "background": "p:c-git-normal", + "background_templates": [ + "{{ if gt .Ahead 0 }}p:c-git-ahead{{ end }}", + "{{ if gt .Behind 0 }}p:c-git-behind{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:c-git-ahead-behind{{ end }}", + "{{ if and (not .Working.Changed) (.Staging.Changed) }}p:c-git-staging{{ end }}", + "{{ if and (.Working.Changed) (.Staging.Changed) }}p:c-git-staging-working{{ end }}", + "{{ if .UpstreamGone }}p:c-git-upstream-gone{{ end }}", + "{{ if and (.Working.Changed) (not .Staging.Changed) }}p:c-git-working{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": " \uE0B6", + "style": "diamond", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "properties": { + "branch_icon": "\uE0A0 ", + "branch_ahead_icon": " \uE621 \uF9AC ", + "branch_behind_icon": " \uE621 \uF9AD ", + "branch_gone_icon": " \uE621 \uF00D", + "branch_identical_icon": " \uE621 \uF00C", + "fetch_status": true, + "fetch_stash_count": true + }, + "trailing_diamond": "\uE0B4", + "type": "git" + } + ], + "type": "prompt" + }, + { + "alignment": "right", + "segments": [ + { + "background_templates": [ + "{{ if lt .Ms 60000 }}p:c-exec-fast{{ end }}", + "{{ if lt .Ms 3600000 }}p:c-exec-normal{{ end }}", + "{{ if lt .Ms 10800000 }}p:c-exec-slow{{ end }}", + "{{ if ge .Ms 10800000 }}p:c-exec-slower{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "properties": { + "style": "austin", + "threshold": 1 + }, + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\uFA1E {{ .FormattedMs }}.{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "executiontime" + }, + { + "background_templates": [ + "{{ if lt .CumulativeTotal.Seconds 3600 }}p:c-wakatime-undertime{{ end }}", + "{{ if lt .CumulativeTotal.Seconds 10800 }}p:c-wakatime-warm-up{{ end }}", + "{{ if lt .CumulativeTotal.Seconds 25200 }}p:c-wakatime-working{{ end }}", + "{{ if lt .CumulativeTotal.Seconds 28000 }}p:c-wakatime-quota{{ end }}", + "{{ if ge .CumulativeTotal.Seconds 28800 }}p:c-wakatime-overtime{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "wakatime" + }, + { + "background_templates": [ + "{{ if regexMatch \"(^(0[6-9])|(1[0-1])):\" (.CurrentDate | date .Format) }}p:c-date-time-morning{{ end }}", + "{{ if regexMatch (\"(^1[2-4]):\") (.CurrentDate | date .Format) }}p:c-date-time-noon{{ end }}", + "{{ if regexMatch (\"(^1[5-7]):\") (.CurrentDate | date .Format) }}p:c-date-time-afternoon{{ end }}", + "{{ if regexMatch \"(^(1[8-9])|(2[0-3])):\" (.CurrentDate | date .Format) }}p:c-date-time-evening{{ end }}", + "{{ if regexMatch \"^(0[0-5]):\" (.CurrentDate | date .Format) }}p:c-date-time-night{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "properties": { + "time_format": "15:04 (01/02)" + }, + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uF5EF {{ .CurrentDate | date .Format }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "time" + }, + { + "background_templates": [ + "{{ if .Error }}p:c-battery-state-error{{ end }}", + "{{ if le .Percentage 15 }}p:c-battery-15-less{{ end }}", + "{{ if and (ge .Percentage 16) (le .Percentage 30) }}p:c-battery-30-less{{ end }}", + "{{ if and (ge .Percentage 31) (le .Percentage 45) }}p:c-battery-45-less{{ end }}", + "{{ if and (ge .Percentage 46) (le .Percentage 55) }}p:c-battery-55-less{{ end }}", + "{{ if and (ge .Percentage 56) (le .Percentage 70) }}p:c-battery-70-less{{ end }}", + "{{ if and (ge .Percentage 71) (le .Percentage 90) }}p:c-battery-90-less{{ end }}", + "{{ if and (ge .Percentage 91) (le .Percentage 100) }}p:c-battery-100-less{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"True\" (title (default \"False\" .Env.DISABLE_SEGMENT_BATTERY)) }}{{ else }}{{ if not .Error }}{{ if eq \"Charging\" .State.String }}\uE315 {{ else if eq \"Discharging\" .State.String }}{{ else if eq \"Full\" .State.String }}~ {{ else }}? {{ end }}{{ if le .Percentage 15 }}\uF579{{ else if and (ge .Percentage 16) (le .Percentage 30) }}\uF57A{{ else if and (ge .Percentage 31) (le .Percentage 45) }}\uF57C{{ else if and (ge .Percentage 46) (le .Percentage 55)}}\uF57D{{ else if and (ge .Percentage 56) (le .Percentage 70) }}\uF57E{{ else if and (ge .Percentage 71) (le .Percentage 80) }}\uF580{{ else if and (ge .Percentage 81) (le .Percentage 95) }}\uF581{{ else }}\uF578{{ end }} {{ .Percentage }}%{{ else }}!{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4", + "type": "battery" + } + ], + "type": "prompt" + }, + { + "alignment": "left", + "newline": true, + "segments": [ + { + "template": "{{ if false }}{{ end }}", + "type": "session", + "style": "diamond" + }, + { + "background_templates": [ + "{{ if and (.Segments.Session.SSHSession) (not .Root) }}p:c-shell-state-ssh-active{{ end }}", + "{{ if and (not .Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-active{{ end }}", + "{{ if and (.Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-ssh-active{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if or (.Segments.Session.SSHSession) (.Root) }}{{ if .Segments.Session.SSHSession }}\uE7A2 SSH{{ end }}{{ if and (.Segments.Session.SSHSession) (.Root) }} \uE621 {{ end }}{{ if .Root }}# Root{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "text" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-crystal{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_CRYSTAL)) }}\uE62F {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "crystal" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-flutter{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_FLUTTER)) }}Flutter | {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "dart" + }, + { + "background_templates": [ + "{{ if .Error }}p:c-project-generic-error{{ else }}p:c-project-lua{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_LUA)) }}\uE620 {{ if or (.Error) (empty .Full) }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "lua" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-node{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_NODE)) }}\uE718 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "node" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-rust{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "style": "diamond", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_RUST)) }}\uE7A8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "rust" + }, + { + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-python{{ end }}" + ], + "foreground": "p:c-badge-text", + "leading_diamond": "\uE0B6", + "properties": { + "display_mode": "context" + }, + "style": "diamond", + "template": "{{ if or (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}\uE235 {{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON)) }}{{ .Full }}{{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }} \uE621 {{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}{{ if .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ else }}{{ .Venv }}{{ end }}{{ end }}{{ end }}", + "trailing_diamond": "\uE0B4 ", + "type": "python" + }, + { + "style": "plain", + "foreground_templates": [ + "{{ if eq \"False\" (title (default \"False\" .Env.ENABLE_ARROW_DIVIDER_COLOR_EXECUTION_RETURN)) }}p:c-badge-white{{ else }}{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}{{ end }}" + ], + "template": "\u276F", + "type": "text" + } + ], + "type": "prompt" + } + ], + "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", + "final_space": true, + "palette": { + "c-badge-folder": "#FFD770", + "c-badge-text": "#212121", + "c-badge-white": "#FAFAFA", + "c-badge-return-custom": "#E7B9FF", + "c-badge-return-fail-term": "#FF8A80", + "c-badge-return-success": "#B2FF59", + "c-battery-15-less": "#FF8A80", + "c-battery-30-less": "#FFD180", + "c-battery-45-less": "#FFE57F", + "c-battery-55-less": "#FFFF8D", + "c-battery-70-less": "#F4FF81", + "c-battery-90-less": "#B9F6CA", + "c-battery-100-less": "#CCFF90", + "c-battery-state-error": "#FF867F", + "c-date-time-morning": "#FFFF8D", + "c-date-time-noon": "#FFF64F", + "c-date-time-afternoon": "#FFC400", + "c-date-time-evening": "#C0CFFF", + "c-date-time-night": "#83B9FF", + "c-exec-fast": "#C6FF00", + "c-exec-normal": "#FFFF00", + "c-exec-slow": "#FFD180", + "c-exec-slower": "#FF867F", + "c-git-ahead": "#6EFFFF", + "c-git-behind": "#FFA06D", + "c-git-ahead-behind": "#C0CFFF", + "c-git-normal": "#66FFA6", + "c-git-staging": "#FFD740", + "c-git-staging-working": "#FFB2FF", + "c-git-upstream-gone": "#FF867F", + "c-git-working": "#84FFFF", + "c-project-generic-error": "#FF867F", + "c-project-crystal": "#FFFFFF", + "c-project-flutter": "#6DC2FF", + "c-project-lua": "#BBC2FF", + "c-project-node": "#9CFF57", + "c-project-rust": "#FFAB40", + "c-project-python": "#FFE873", + "c-secondary-ellipsis": "#FFFF8D", + "c-shell-state-ssh-active": "#BAFFFF", + "c-shell-state-root-active": "#9FFFE0", + "c-shell-state-root-ssh-active": "#FFB2FF", + "c-wakatime-undertime": "#A7FFEB", + "c-wakatime-warm-up": "#FFFFB3", + "c-wakatime-working": "#FFD180", + "c-wakatime-quota": "#FFD0B0", + "c-wakatime-overtime": "#FF8A80" + }, + "transient_prompt": { + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B6\uF55D \uE0B1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\uFA1E {{ .Segments.Executiontime.FormattedMs }} \uE621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B4 {{ end }}\u276F " + }, + "secondary_prompt": { + "background": "transparent", + "foreground": "p:c-secondary-ellipsis", + "template": " ... " + }, + "version": 2 +} From 118f6dfdc154848bc9f0ed0d2ef17f99bf6c072e Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 16:17:48 +0800 Subject: [PATCH 05/13] fix(package): fix cmd `copy-to-git` overriding local when supposed to be `git` repo instead --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f2de8a9..bbbf7cb 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "chips.omp.json", - "version": "1.2.0", + "version": "1.3.0", "description": "Non-Standard Compliant Material Design-Inspired Chips Theme for Oh-My-Posh Theme.", "scripts": { "copy-to-local": "pwsh -NoProfile -Command Copy-Item -Destination \"./\" -Path \"~/chips.omp.json\" -Confirm", "copy-to-local-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"~/chips.omp.json\" -Path \"chips-double-width.omp.json\" -Confirm", - "copy-to-git": "pwsh -NoProfile -Command Copy-Item -Destination \"~/\" -Path \"chips.omp.json\" -Confirm", + "copy-to-git": "pwsh -NoProfile -Command Copy-Item -Destination \"chips.omp.json\" -Path \"~/chips.omp.json\" -Confirm", "copy-to-git-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"chips-double-width.omp.json\" -Path \"~/chips.omp.json\" -Confirm", "snapshot-local-ref": "pwsh -Command Write-Host \"oh-my-posh config export image --author 'CodexLink, More Samples at https://github.com/CodexLink/chips.omp.json' --config ~/chips.omp.json --cursor-padding 20 --rprompt-offset 20 --output highlight.png\"", "snapshot-remote": "oh-my-posh config export image --author 'CodexLink, More Samples at https://github.com/CodexLink/chips.omp.json' --config chips.omp.json --cursor-padding 20 --rprompt-offset 20 --output assets\\highlight_temp.png" From 964d76a9f19bfefe0917b844308519d1af15db9f Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 16:27:42 +0800 Subject: [PATCH 06/13] fix(double-width): fix missing glyphs for battery segment --- chips-double-width.omp.json | 394 +++++++++++++++++++----------------- 1 file changed, 213 insertions(+), 181 deletions(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index b443729..8958199 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -1,30 +1,106 @@ { "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "palette": { + "c-badge-folder": "#FFD770", + "c-badge-return-custom": "#E7B9FF", + "c-badge-return-fail-term": "#FF8A80", + "c-badge-return-success": "#B2FF59", + "c-badge-text": "#212121", + "c-badge-white": "#FAFAFA", + "c-battery-100-less": "#CCFF90", + "c-battery-15-less": "#FF8A80", + "c-battery-30-less": "#FFD180", + "c-battery-45-less": "#FFE57F", + "c-battery-55-less": "#FFFF8D", + "c-battery-70-less": "#F4FF81", + "c-battery-90-less": "#B9F6CA", + "c-battery-state-error": "#FF867F", + "c-date-time-afternoon": "#FFC400", + "c-date-time-evening": "#C0CFFF", + "c-date-time-morning": "#FFFF8D", + "c-date-time-night": "#83B9FF", + "c-date-time-noon": "#FFF64F", + "c-exec-fast": "#C6FF00", + "c-exec-normal": "#FFFF00", + "c-exec-slow": "#FFD180", + "c-exec-slower": "#FF867F", + "c-git-ahead": "#6EFFFF", + "c-git-ahead-behind": "#C0CFFF", + "c-git-behind": "#FFA06D", + "c-git-normal": "#66FFA6", + "c-git-staging": "#FFD740", + "c-git-staging-working": "#FFB2FF", + "c-git-upstream-gone": "#FF867F", + "c-git-working": "#84FFFF", + "c-project-crystal": "#FFFFFF", + "c-project-flutter": "#6DC2FF", + "c-project-generic-error": "#FF867F", + "c-project-lua": "#BBC2FF", + "c-project-node": "#9CFF57", + "c-project-python": "#FFE873", + "c-project-rust": "#FFAB40", + "c-secondary-ellipsis": "#FFFF8D", + "c-shell-state-root-active": "#9FFFE0", + "c-shell-state-root-ssh-active": "#FFB2FF", + "c-shell-state-ssh-active": "#BAFFFF", + "c-wakatime-overtime": "#FF8A80", + "c-wakatime-quota": "#FFD0B0", + "c-wakatime-undertime": "#A7FFEB", + "c-wakatime-warm-up": "#FFFFB3", + "c-wakatime-working": "#FFD180" + }, + "secondary_prompt": { + "template": " ... ", + "foreground": "p:c-secondary-ellipsis", + "background": "transparent" + }, + "transient_prompt": { + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b6\uf55d \ue0b1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\ufa1e {{ .Segments.Executiontime.FormattedMs }} \ue621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b4 {{ end }}❯ " + }, + "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", "blocks": [ { + "type": "prompt", "alignment": "left", "segments": [ { - "background_templates": [ - "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_BG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_BG }}{{ else }}p:c-badge-folder{{ end }}" - ], - "foreground_templates": [ - "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_FG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_FG }}{{ else }}p:c-badge-text{{ end }}" - ], - "leading_diamond": "\uE0B6", "properties": { - "style": "agnoster_short", + "cache_duration": "none", "folder_separator_icon": "/", "hide_root_location": true, - "max_depth": 2 + "max_depth": 2, + "style": "agnoster_short" }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\uf07b {{ .Path }}", + "type": "path", "style": "diamond", - "template": "\uF07B {{ .Path }}", - "trailing_diamond": "\uE0B4", - "type": "path" + "foreground_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_FG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_FG }}{{ else }}p:c-badge-text{{ end }}" + ], + "background_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_BG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_BG }}{{ else }}p:c-badge-folder{{ end }}" + ] }, { + "properties": { + "branch_ahead_icon": " \ue621 \uf0a9 ", + "branch_behind_icon": " \ue621 \uf0a8 ", + "branch_gone_icon": " \ue621 \uf00d ", + "branch_icon": "\ue725 ", + "branch_identical_icon": " \ue621 \uf00c ", + "cache_duration": "none", + "fetch_stash_count": true, + "fetch_status": true + }, + "leading_diamond": " \ue0b6", + "trailing_diamond": "\ue0b4", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \ue0b1 \uf448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \ue621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \ue0b1 {{ end }}\uf854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ue621 \uf6fc {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "foreground": "p:c-badge-text", "background": "p:c-git-normal", + "type": "git", + "style": "diamond", "background_templates": [ "{{ if gt .Ahead 0 }}p:c-git-ahead{{ end }}", "{{ if gt .Behind 0 }}p:c-git-behind{{ end }}", @@ -33,81 +109,77 @@ "{{ if and (.Working.Changed) (.Staging.Changed) }}p:c-git-staging-working{{ end }}", "{{ if .UpstreamGone }}p:c-git-upstream-gone{{ end }}", "{{ if and (.Working.Changed) (not .Staging.Changed) }}p:c-git-working{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": " \uE0B6", - "style": "diamond", - "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", - "properties": { - "branch_icon": "\uE725 ", - "branch_ahead_icon": " \uE621 \uF0A9 ", - "branch_behind_icon": " \uE621 \uF0A8 ", - "branch_gone_icon": " \uE621 \uF00D ", - "branch_identical_icon": " \uE621 \uF00C ", - "fetch_status": true, - "fetch_stash_count": true - }, - "trailing_diamond": "\uE0B4", - "type": "git" + ] } - ], - "type": "prompt" + ] }, { + "type": "prompt", "alignment": "right", "segments": [ { - "background_templates": [ - "{{ if lt .Ms 60000 }}p:c-exec-fast{{ end }}", - "{{ if lt .Ms 3600000 }}p:c-exec-normal{{ end }}", - "{{ if lt .Ms 10800000 }}p:c-exec-slow{{ end }}", - "{{ if ge .Ms 10800000 }}p:c-exec-slower{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", "properties": { + "cache_duration": "none", "style": "austin", "threshold": 1 }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\ufa1e {{ .FormattedMs }}.{{ end }}", + "foreground": "p:c-badge-text", + "type": "executiontime", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\uFA1E {{ .FormattedMs }}.{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "executiontime" + "background_templates": [ + "{{ if lt .Ms 60000 }}p:c-exec-fast{{ end }}", + "{{ if lt .Ms 3600000 }}p:c-exec-normal{{ end }}", + "{{ if lt .Ms 10800000 }}p:c-exec-slow{{ end }}", + "{{ if ge .Ms 10800000 }}p:c-exec-slower{{ end }}" + ] }, { + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\ufa19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", + "foreground": "p:c-badge-text", + "type": "wakatime", + "style": "diamond", "background_templates": [ "{{ if lt .CumulativeTotal.Seconds 3600 }}p:c-wakatime-undertime{{ end }}", "{{ if lt .CumulativeTotal.Seconds 10800 }}p:c-wakatime-warm-up{{ end }}", "{{ if lt .CumulativeTotal.Seconds 25200 }}p:c-wakatime-working{{ end }}", "{{ if lt .CumulativeTotal.Seconds 28000 }}p:c-wakatime-quota{{ end }}", "{{ if ge .CumulativeTotal.Seconds 28800 }}p:c-wakatime-overtime{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", - "style": "diamond", - "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "wakatime" + ] }, { + "properties": { + "cache_duration": "none", + "time_format": "15:04 (01/02)" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uf017 {{ .CurrentDate | date .Format }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "time", + "style": "diamond", "background_templates": [ "{{ if regexMatch \"(^(0[6-9])|(1[0-1])):\" (.CurrentDate | date .Format) }}p:c-date-time-morning{{ end }}", "{{ if regexMatch (\"(^1[2-4]):\") (.CurrentDate | date .Format) }}p:c-date-time-noon{{ end }}", "{{ if regexMatch (\"(^1[5-7]):\") (.CurrentDate | date .Format) }}p:c-date-time-afternoon{{ end }}", "{{ if regexMatch \"(^(1[8-9])|(2[0-3])):\" (.CurrentDate | date .Format) }}p:c-date-time-evening{{ end }}", "{{ if regexMatch \"^(0[0-5]):\" (.CurrentDate | date .Format) }}p:c-date-time-night{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + ] + }, + { "properties": { - "time_format": "15:04 (01/02)" + "cache_duration": "none" }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "{{ if eq \"True\" (title (default \"False\" .Env.DISABLE_SEGMENT_BATTERY)) }}{{ else }}{{ if not .Error }}{{ if eq \"Charging\" .State.String }}\uf0e7 {{ else if eq \"Discharging\" .State.String }}{{ else if eq \"Full\" .State.String }}~ {{ else }}? {{ end }}{{ if le .Percentage 15 }}\udb80\udc7a{{ else if and (ge .Percentage 16) (le .Percentage 30) }}\udb80\udc7b{{ else if and (ge .Percentage 31) (le .Percentage 45) }}\udb80\udc7d{{ else if and (ge .Percentage 46) (le .Percentage 55)}}\udb80\udc7e{{ else if and (ge .Percentage 56) (le .Percentage 70) }}\udb80\udc7f{{ else if and (ge .Percentage 71) (le .Percentage 80) }}\udb80\udc81{{ else if and (ge .Percentage 81) (le .Percentage 95) }}\udb80\udc82{{ else }}\udb80\udc79{{ end }} {{ .Percentage }}%{{ else }}!{{ end }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "battery", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uF017 {{ .CurrentDate | date .Format }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "time" - }, - { "background_templates": [ "{{ if .Error }}p:c-battery-state-error{{ end }}", "{{ if le .Percentage 15 }}p:c-battery-15-less{{ end }}", @@ -117,178 +189,138 @@ "{{ if and (ge .Percentage 56) (le .Percentage 70) }}p:c-battery-70-less{{ end }}", "{{ if and (ge .Percentage 71) (le .Percentage 90) }}p:c-battery-90-less{{ end }}", "{{ if and (ge .Percentage 91) (le .Percentage 100) }}p:c-battery-100-less{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", - "style": "diamond", - "template": "{{ if eq \"True\" (title (default \"False\" .Env.DISABLE_SEGMENT_BATTERY)) }}{{ else }}{{ if not .Error }}{{ if eq \"Charging\" .State.String }}\uF0E7 {{ else if eq \"Discharging\" .State.String }}{{ else if eq \"Full\" .State.String }}~ {{ else }}? {{ end }}{{ if le .Percentage 15 }}\uF579{{ else if and (ge .Percentage 16) (le .Percentage 30) }}\uF57A{{ else if and (ge .Percentage 31) (le .Percentage 45) }}\uF57C{{ else if and (ge .Percentage 46) (le .Percentage 55)}}\uF57D{{ else if and (ge .Percentage 56) (le .Percentage 70) }}\uF57E{{ else if and (ge .Percentage 71) (le .Percentage 80) }}\uF580{{ else if and (ge .Percentage 81) (le .Percentage 95) }}\uF581{{ else }}\uF578{{ end }} {{ .Percentage }}%{{ else }}!{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4", - "type": "battery" + ] } - ], - "type": "prompt" + ] }, { + "type": "prompt", "alignment": "left", - "newline": true, "segments": [ { + "properties": { + "cache_duration": "none" + }, "template": "{{ if false }}{{ end }}", "type": "session", "style": "diamond" }, { + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if or (.Segments.Session.SSHSession) (.Root) }}{{ if .Segments.Session.SSHSession }}\ue7a2 SSH{{ end }}{{ if and (.Segments.Session.SSHSession) (.Root) }} \ue621 {{ end }}{{ if .Root }}# Root{{ end }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "text", + "style": "diamond", "background_templates": [ "{{ if and (.Segments.Session.SSHSession) (not .Root) }}p:c-shell-state-ssh-active{{ end }}", "{{ if and (not .Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-active{{ end }}", "{{ if and (.Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-ssh-active{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", - "style": "diamond", - "template": "{{ if or (.Segments.Session.SSHSession) (.Root) }}{{ if .Segments.Session.SSHSession }}\uE7A2 SSH{{ end }}{{ if and (.Segments.Session.SSHSession) (.Root) }} \uE621 {{ end }}{{ if .Root }}# Root{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "text" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-crystal{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_CRYSTAL)) }}\ue62f {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "crystal", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_CRYSTAL)) }}\uE62F {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "crystal" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-crystal{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-flutter{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_FLUTTER)) }}Flutter | {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "dart", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_FLUTTER)) }}Flutter | {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "dart" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-flutter{{ end }}" + ] }, { - "background_templates": [ - "{{ if .Error }}p:c-project-generic-error{{ else }}p:c-project-lua{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_LUA)) }}\ue620 {{ if or (.Error) (empty .Full) }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "lua", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_LUA)) }}\uE620 {{ if or (.Error) (empty .Full) }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "lua" + "background_templates": [ + "{{ if .Error }}p:c-project-generic-error{{ else }}p:c-project-lua{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-node{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_NODE)) }}\ue718 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "node", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_NODE)) }}\uE718 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "node" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-node{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-rust{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_RUST)) }}\ue7a8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "rust", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_RUST)) }}\uE7A8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "rust" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-rust{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-python{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", "properties": { + "cache_duration": "none", "display_mode": "context" }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if or (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}\ue235 {{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON)) }}{{ .Full }}{{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }} \ue621 {{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}{{ if .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ else }}{{ .Venv }}{{ end }}{{ end }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "python", "style": "diamond", - "template": "{{ if or (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}\uE235 {{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON)) }}{{ .Full }}{{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }} \uE621 {{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}{{ if .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ else }}{{ .Venv }}{{ end }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "python" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-python{{ end }}" + ] }, { + "properties": { + "cache_duration": "none" + }, + "template": "❯", + "type": "text", "style": "plain", "foreground_templates": [ "{{ if eq \"False\" (title (default \"False\" .Env.ENABLE_ARROW_DIVIDER_COLOR_EXECUTION_RETURN)) }}p:c-badge-white{{ else }}{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}{{ end }}" - ], - "template": "\u276F", - "type": "text" + ] } ], - "type": "prompt" + "newline": true } ], - "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", - "final_space": true, - "palette": { - "c-badge-folder": "#FFD770", - "c-badge-text": "#212121", - "c-badge-white": "#FAFAFA", - "c-badge-return-custom": "#E7B9FF", - "c-badge-return-fail-term": "#FF8A80", - "c-badge-return-success": "#B2FF59", - "c-battery-15-less": "#FF8A80", - "c-battery-30-less": "#FFD180", - "c-battery-45-less": "#FFE57F", - "c-battery-55-less": "#FFFF8D", - "c-battery-70-less": "#F4FF81", - "c-battery-90-less": "#B9F6CA", - "c-battery-100-less": "#CCFF90", - "c-battery-state-error": "#FF867F", - "c-date-time-morning": "#FFFF8D", - "c-date-time-noon": "#FFF64F", - "c-date-time-afternoon": "#FFC400", - "c-date-time-evening": "#C0CFFF", - "c-date-time-night": "#83B9FF", - "c-exec-fast": "#C6FF00", - "c-exec-normal": "#FFFF00", - "c-exec-slow": "#FFD180", - "c-exec-slower": "#FF867F", - "c-git-ahead": "#6EFFFF", - "c-git-behind": "#FFA06D", - "c-git-ahead-behind": "#C0CFFF", - "c-git-normal": "#66FFA6", - "c-git-staging": "#FFD740", - "c-git-staging-working": "#FFB2FF", - "c-git-upstream-gone": "#FF867F", - "c-git-working": "#84FFFF", - "c-project-generic-error": "#FF867F", - "c-project-crystal": "#FFFFFF", - "c-project-flutter": "#6DC2FF", - "c-project-lua": "#BBC2FF", - "c-project-node": "#9CFF57", - "c-project-rust": "#FFAB40", - "c-project-python": "#FFE873", - "c-secondary-ellipsis": "#FFFF8D", - "c-shell-state-ssh-active": "#BAFFFF", - "c-shell-state-root-active": "#9FFFE0", - "c-shell-state-root-ssh-active": "#FFB2FF", - "c-wakatime-undertime": "#A7FFEB", - "c-wakatime-warm-up": "#FFFFB3", - "c-wakatime-working": "#FFD180", - "c-wakatime-quota": "#FFD0B0", - "c-wakatime-overtime": "#FF8A80" - }, - "transient_prompt": { - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B6\uF55D \uE0B1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\uFA1E {{ .Segments.Executiontime.FormattedMs }} \uE621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B4 {{ end }}\u276F " - }, - "secondary_prompt": { - "background": "transparent", - "foreground": "p:c-secondary-ellipsis", - "template": " ... " - }, - "version": 2 + "version": 3, + "final_space": true } From 82a0d5691b2a453458a28d8344c01eda6f11c4c4 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 16:35:43 +0800 Subject: [PATCH 07/13] fix(execution-time): fix missing glyphs --- chips-double-width.omp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index 8958199..ba1006c 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -125,7 +125,7 @@ }, "leading_diamond": "\ue0b6", "trailing_diamond": "\ue0b4 ", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\ufa1e {{ .FormattedMs }}.{{ end }}", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\udb81\udd1f {{ .FormattedMs }}.{{ end }}", "foreground": "p:c-badge-text", "type": "executiontime", "style": "diamond", From 608ff4acc348f806b08d992bbe96f00e2e3dbb17 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 16:42:51 +0800 Subject: [PATCH 08/13] fix(transient-prompt): fix missing glyphs --- chips-double-width.omp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index ba1006c..f2ce5da 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -55,7 +55,7 @@ "background": "transparent" }, "transient_prompt": { - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b6\uf55d \ue0b1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\ufa1e {{ .Segments.Executiontime.FormattedMs }} \ue621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b4 {{ end }}❯ " + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b6\udb80\udc5e \ue0b1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\udb81\udd1f {{ .Segments.Executiontime.FormattedMs }} \ue621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b4 {{ end }}❯ " }, "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", "blocks": [ From ace4324bf71fd560426825673c39076bb23fb374 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 16:58:29 +0800 Subject: [PATCH 09/13] fix(git): fix missing glyhs + wakatime explicit cache properties --- chips-double-width.omp.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index f2ce5da..308999e 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -96,7 +96,7 @@ }, "leading_diamond": " \ue0b6", "trailing_diamond": "\ue0b4", - "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \ue0b1 \uf448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \ue621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \ue0b1 {{ end }}\uf854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ue621 \uf6fc {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \ue0b1 \uf448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \ue621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \ue0b1 {{ end }}\udb80\udf55 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ue621 \udb80\uddfd {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", "foreground": "p:c-badge-text", "background": "p:c-git-normal", "type": "git", @@ -141,6 +141,13 @@ "trailing_diamond": "\ue0b4 ", "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\ufa19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", "foreground": "p:c-badge-text", + "cache": { + "duration": "5m0s", + "strategy": "session" + }, + "properties": { + "http_timeout": 500 + }, "type": "wakatime", "style": "diamond", "background_templates": [ From dc4a5e66ab7d03eb5dacc7fedc46d96221f57ef8 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 17:20:51 +0800 Subject: [PATCH 10/13] fix(package): fix cmd `copy-to-local` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbbf7cb..f1d9b40 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.3.0", "description": "Non-Standard Compliant Material Design-Inspired Chips Theme for Oh-My-Posh Theme.", "scripts": { - "copy-to-local": "pwsh -NoProfile -Command Copy-Item -Destination \"./\" -Path \"~/chips.omp.json\" -Confirm", + "copy-to-local": "pwsh -NoProfile -Command Copy-Item -Destination \"~/chips.omp.json\" -Path \"chips.omp.json\" -Confirm", "copy-to-local-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"~/chips.omp.json\" -Path \"chips-double-width.omp.json\" -Confirm", "copy-to-git": "pwsh -NoProfile -Command Copy-Item -Destination \"chips.omp.json\" -Path \"~/chips.omp.json\" -Confirm", "copy-to-git-double-width": "pwsh -NoProfile -Command Copy-Item -Destination \"chips-double-width.omp.json\" -Path \"~/chips.omp.json\" -Confirm", From 2546fa7a8bc8734c69058329bd2b785a5d7f9e17 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 18:32:38 +0800 Subject: [PATCH 11/13] chore(double-width): add more space from `git` segment --- chips-double-width.omp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chips-double-width.omp.json b/chips-double-width.omp.json index 308999e..8c9c977 100644 --- a/chips-double-width.omp.json +++ b/chips-double-width.omp.json @@ -96,7 +96,7 @@ }, "leading_diamond": " \ue0b6", "trailing_diamond": "\ue0b4", - "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \ue0b1 \uf448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \ue621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \ue0b1 {{ end }}\udb80\udf55 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ue621 \udb80\uddfd {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \ue0b1 \uf448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \ue621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \ue0b1 {{ end }}\udb80\udf55 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ue621 \udb80\uddfd {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", "foreground": "p:c-badge-text", "background": "p:c-git-normal", "type": "git", From 7653400b7eb7ade1697c893f3988712c90b08b06 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 18:34:37 +0800 Subject: [PATCH 12/13] fix(single-width): add fixes from double-width --- chips.omp.json | 399 +++++++++++++++++++++++++++---------------------- 1 file changed, 219 insertions(+), 180 deletions(-) diff --git a/chips.omp.json b/chips.omp.json index 4dff094..c32a503 100644 --- a/chips.omp.json +++ b/chips.omp.json @@ -1,30 +1,106 @@ { "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "palette": { + "c-badge-folder": "#FFD770", + "c-badge-return-custom": "#E7B9FF", + "c-badge-return-fail-term": "#FF8A80", + "c-badge-return-success": "#B2FF59", + "c-badge-text": "#212121", + "c-badge-white": "#FAFAFA", + "c-battery-100-less": "#CCFF90", + "c-battery-15-less": "#FF8A80", + "c-battery-30-less": "#FFD180", + "c-battery-45-less": "#FFE57F", + "c-battery-55-less": "#FFFF8D", + "c-battery-70-less": "#F4FF81", + "c-battery-90-less": "#B9F6CA", + "c-battery-state-error": "#FF867F", + "c-date-time-afternoon": "#FFC400", + "c-date-time-evening": "#C0CFFF", + "c-date-time-morning": "#FFFF8D", + "c-date-time-night": "#83B9FF", + "c-date-time-noon": "#FFF64F", + "c-exec-fast": "#C6FF00", + "c-exec-normal": "#FFFF00", + "c-exec-slow": "#FFD180", + "c-exec-slower": "#FF867F", + "c-git-ahead": "#6EFFFF", + "c-git-ahead-behind": "#C0CFFF", + "c-git-behind": "#FFA06D", + "c-git-normal": "#66FFA6", + "c-git-staging": "#FFD740", + "c-git-staging-working": "#FFB2FF", + "c-git-upstream-gone": "#FF867F", + "c-git-working": "#84FFFF", + "c-project-crystal": "#FFFFFF", + "c-project-flutter": "#6DC2FF", + "c-project-generic-error": "#FF867F", + "c-project-lua": "#BBC2FF", + "c-project-node": "#9CFF57", + "c-project-python": "#FFE873", + "c-project-rust": "#FFAB40", + "c-secondary-ellipsis": "#FFFF8D", + "c-shell-state-root-active": "#9FFFE0", + "c-shell-state-root-ssh-active": "#FFB2FF", + "c-shell-state-ssh-active": "#BAFFFF", + "c-wakatime-overtime": "#FF8A80", + "c-wakatime-quota": "#FFD0B0", + "c-wakatime-undertime": "#A7FFEB", + "c-wakatime-warm-up": "#FFFFB3", + "c-wakatime-working": "#FFD180" + }, + "secondary_prompt": { + "template": " ... ", + "foreground": "p:c-secondary-ellipsis", + "background": "transparent" + }, + "transient_prompt": { + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b6\udb80\udc5e \ue0b1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\udb81\udd1f {{ .Segments.Executiontime.FormattedMs }} \ue621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\ue0b4 {{ end }}❯ " + }, + "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", "blocks": [ { + "type": "prompt", "alignment": "left", "segments": [ { - "background_templates": [ - "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_BG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_BG }}{{ else }}p:c-badge-folder{{ end }}" - ], - "foreground_templates": [ - "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_FG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_FG }}{{ else }}p:c-badge-text{{ end }}" - ], - "leading_diamond": "\uE0B6", "properties": { - "style": "agnoster_short", + "cache_duration": "none", "folder_separator_icon": "/", "hide_root_location": true, - "max_depth": 2 + "max_depth": 2, + "style": "agnoster_short" }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "\uf07b {{ .Path }}", + "type": "path", "style": "diamond", - "template": "\uF07B {{ .Path }}", - "trailing_diamond": "\uE0B4", - "type": "path" + "foreground_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_FG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_FG }}{{ else }}p:c-badge-text{{ end }}" + ], + "background_templates": [ + "{{ if not (empty .Env.OVERRIDE_FOLDER_BADGE_BG) }}{{ .Env.OVERRIDE_FOLDER_BADGE_BG }}{{ else }}p:c-badge-folder{{ end }}" + ] }, { + "properties": { + "branch_ahead_icon": " \ue621 \uf9ac ", + "branch_behind_icon": " \ue621 \uf9ad ", + "branch_gone_icon": " \ue621 \uf00d", + "branch_icon": "\ue0a0 ", + "branch_identical_icon": " \ue621 \uf00c", + "cache_duration": "none", + "fetch_stash_count": true, + "fetch_status": true + }, + "leading_diamond": " \ue0b6", + "trailing_diamond": "\ue0b4", + "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \ue0b1 \uf448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \ue621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \ue0b1 {{ end }}\udb80\udf55 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ue621 \ufa1e {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", + "foreground": "p:c-badge-text", "background": "p:c-git-normal", + "type": "git", + "style": "diamond", "background_templates": [ "{{ if gt .Ahead 0 }}p:c-git-ahead{{ end }}", "{{ if gt .Behind 0 }}p:c-git-behind{{ end }}", @@ -33,81 +109,84 @@ "{{ if and (.Working.Changed) (.Staging.Changed) }}p:c-git-staging-working{{ end }}", "{{ if .UpstreamGone }}p:c-git-upstream-gone{{ end }}", "{{ if and (.Working.Changed) (not .Staging.Changed) }}p:c-git-working{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": " \uE0B6", - "style": "diamond", - "template": "{{ if (empty (.Ref)) }}invalid-git-dir{{ else }}{{ .HEAD }}{{ end }}{{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE621 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uE0B1 {{ end }}\uF854 ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \uE621 \uF6FC {{ .StashCount }} Stash{{ if gt .StashCount 1 }}es{{ end }}{{ end }}", - "properties": { - "branch_icon": "\uE0A0 ", - "branch_ahead_icon": " \uE621 \uF9AC ", - "branch_behind_icon": " \uE621 \uF9AD ", - "branch_gone_icon": " \uE621 \uF00D", - "branch_identical_icon": " \uE621 \uF00C", - "fetch_status": true, - "fetch_stash_count": true - }, - "trailing_diamond": "\uE0B4", - "type": "git" + ] } - ], - "type": "prompt" + ] }, { + "type": "prompt", "alignment": "right", "segments": [ { + "properties": { + "cache_duration": "none", + "style": "austin", + "threshold": 1 + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\udb81\udd1f {{ .FormattedMs }}.{{ end }}", + "foreground": "p:c-badge-text", + "type": "executiontime", + "style": "diamond", "background_templates": [ "{{ if lt .Ms 60000 }}p:c-exec-fast{{ end }}", "{{ if lt .Ms 3600000 }}p:c-exec-normal{{ end }}", "{{ if lt .Ms 10800000 }}p:c-exec-slow{{ end }}", "{{ if ge .Ms 10800000 }}p:c-exec-slower{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + ] + }, + { + "cache": { + "duration": "5m0s", + "strategy": "session" + }, "properties": { - "style": "austin", - "threshold": 1 + "http_timeout": 500 }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\ufa19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", + "foreground": "p:c-badge-text", + "type": "wakatime", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PRIMARY_EXEC_TIME)) }}\uFA1E {{ .FormattedMs }}.{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "executiontime" - }, - { "background_templates": [ "{{ if lt .CumulativeTotal.Seconds 3600 }}p:c-wakatime-undertime{{ end }}", "{{ if lt .CumulativeTotal.Seconds 10800 }}p:c-wakatime-warm-up{{ end }}", "{{ if lt .CumulativeTotal.Seconds 25200 }}p:c-wakatime-working{{ end }}", "{{ if lt .CumulativeTotal.Seconds 28000 }}p:c-wakatime-quota{{ end }}", "{{ if ge .CumulativeTotal.Seconds 28800 }}p:c-wakatime-overtime{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", - "style": "diamond", - "template": "{{ if and (.Env.WAKATIME_API_KEY) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_WAKATIME))) (gt .CumulativeTotal.Seconds 0) }}\uFA19 {{ secondsRound .CumulativeTotal.Seconds }}.{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "wakatime" + ] }, { + "properties": { + "cache_duration": "none", + "time_format": "15:04 (01/02)" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uf017 {{ .CurrentDate | date .Format }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "time", + "style": "diamond", "background_templates": [ "{{ if regexMatch \"(^(0[6-9])|(1[0-1])):\" (.CurrentDate | date .Format) }}p:c-date-time-morning{{ end }}", "{{ if regexMatch (\"(^1[2-4]):\") (.CurrentDate | date .Format) }}p:c-date-time-noon{{ end }}", "{{ if regexMatch (\"(^1[5-7]):\") (.CurrentDate | date .Format) }}p:c-date-time-afternoon{{ end }}", "{{ if regexMatch \"(^(1[8-9])|(2[0-3])):\" (.CurrentDate | date .Format) }}p:c-date-time-evening{{ end }}", "{{ if regexMatch \"^(0[0-5]):\" (.CurrentDate | date .Format) }}p:c-date-time-night{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + ] + }, + { "properties": { - "time_format": "15:04 (01/02)" + "cache_duration": "none" }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4", + "template": "{{ if eq \"True\" (title (default \"False\" .Env.DISABLE_SEGMENT_BATTERY)) }}{{ else }}{{ if not .Error }}{{ if eq \"Charging\" .State.String }}\ue315 {{ else if eq \"Discharging\" .State.String }}{{ else if eq \"Full\" .State.String }}~ {{ else }}? {{ end }}{{ if le .Percentage 15 }}\udb80\udc7a{{ else if and (ge .Percentage 16) (le .Percentage 30) }}\udb80\udc7b{{ else if and (ge .Percentage 31) (le .Percentage 45) }}\udb80\udc7d{{ else if and (ge .Percentage 46) (le .Percentage 55)}}\udb80\udc7e{{ else if and (ge .Percentage 56) (le .Percentage 70) }}\udb80\udc7f{{ else if and (ge .Percentage 71) (le .Percentage 80) }}\udb80\udc81{{ else if and (ge .Percentage 81) (le .Percentage 95) }}\udb80\udc82{{ else }}\udb80\udc79{{ end }} {{ .Percentage }}%{{ else }}!{{ end }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "battery", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uF5EF {{ .CurrentDate | date .Format }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "time" - }, - { "background_templates": [ "{{ if .Error }}p:c-battery-state-error{{ end }}", "{{ if le .Percentage 15 }}p:c-battery-15-less{{ end }}", @@ -117,178 +196,138 @@ "{{ if and (ge .Percentage 56) (le .Percentage 70) }}p:c-battery-70-less{{ end }}", "{{ if and (ge .Percentage 71) (le .Percentage 90) }}p:c-battery-90-less{{ end }}", "{{ if and (ge .Percentage 91) (le .Percentage 100) }}p:c-battery-100-less{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", - "style": "diamond", - "template": "{{ if eq \"True\" (title (default \"False\" .Env.DISABLE_SEGMENT_BATTERY)) }}{{ else }}{{ if not .Error }}{{ if eq \"Charging\" .State.String }}\uE315 {{ else if eq \"Discharging\" .State.String }}{{ else if eq \"Full\" .State.String }}~ {{ else }}? {{ end }}{{ if le .Percentage 15 }}\uF579{{ else if and (ge .Percentage 16) (le .Percentage 30) }}\uF57A{{ else if and (ge .Percentage 31) (le .Percentage 45) }}\uF57C{{ else if and (ge .Percentage 46) (le .Percentage 55)}}\uF57D{{ else if and (ge .Percentage 56) (le .Percentage 70) }}\uF57E{{ else if and (ge .Percentage 71) (le .Percentage 80) }}\uF580{{ else if and (ge .Percentage 81) (le .Percentage 95) }}\uF581{{ else }}\uF578{{ end }} {{ .Percentage }}%{{ else }}!{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4", - "type": "battery" + ] } - ], - "type": "prompt" + ] }, { + "type": "prompt", "alignment": "left", - "newline": true, "segments": [ { + "properties": { + "cache_duration": "none" + }, "template": "{{ if false }}{{ end }}", "type": "session", "style": "diamond" }, { + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if or (.Segments.Session.SSHSession) (.Root) }}{{ if .Segments.Session.SSHSession }}\ue7a2 SSH{{ end }}{{ if and (.Segments.Session.SSHSession) (.Root) }} \ue621 {{ end }}{{ if .Root }}# Root{{ end }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "text", + "style": "diamond", "background_templates": [ "{{ if and (.Segments.Session.SSHSession) (not .Root) }}p:c-shell-state-ssh-active{{ end }}", "{{ if and (not .Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-active{{ end }}", "{{ if and (.Segments.Session.SSHSession) (.Root) }}p:c-shell-state-root-ssh-active{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", - "style": "diamond", - "template": "{{ if or (.Segments.Session.SSHSession) (.Root) }}{{ if .Segments.Session.SSHSession }}\uE7A2 SSH{{ end }}{{ if and (.Segments.Session.SSHSession) (.Root) }} \uE621 {{ end }}{{ if .Root }}# Root{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "text" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-crystal{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_CRYSTAL)) }}\ue62f {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "crystal", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_CRYSTAL)) }}\uE62F {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "crystal" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-crystal{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-flutter{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_FLUTTER)) }}Flutter | {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "dart", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_FLUTTER)) }}Flutter | {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "dart" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-flutter{{ end }}" + ] }, { - "background_templates": [ - "{{ if .Error }}p:c-project-generic-error{{ else }}p:c-project-lua{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_LUA)) }}\ue620 {{ if or (.Error) (empty .Full) }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "lua", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_LUA)) }}\uE620 {{ if or (.Error) (empty .Full) }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "lua" + "background_templates": [ + "{{ if .Error }}p:c-project-generic-error{{ else }}p:c-project-lua{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-node{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_NODE)) }}\ue718 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "node", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_NODE)) }}\uE718 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "node" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-node{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-rust{{ end }}" - ], + "properties": { + "cache_duration": "none" + }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_RUST)) }}\ue7a8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", + "type": "rust", "style": "diamond", - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_RUST)) }}\uE7A8 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "rust" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-rust{{ end }}" + ] }, { - "background_templates": [ - "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-python{{ end }}" - ], - "foreground": "p:c-badge-text", - "leading_diamond": "\uE0B6", "properties": { + "cache_duration": "none", "display_mode": "context" }, + "leading_diamond": "\ue0b6", + "trailing_diamond": "\ue0b4 ", + "template": "{{ if or (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}\ue235 {{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON)) }}{{ .Full }}{{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }} \ue621 {{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}{{ if .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ else }}{{ .Venv }}{{ end }}{{ end }}{{ end }}", + "foreground": "p:c-badge-text", + "type": "python", "style": "diamond", - "template": "{{ if or (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}\uE235 {{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON)) }}{{ .Full }}{{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON))) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }} \uE621 {{ end }}{{ if and (.Venv) (eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_PROJECT_PYTHON_VENV))) }}{{ if .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ .Env.SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR }}{{ else }}{{ .Venv }}{{ end }}{{ end }}{{ end }}", - "trailing_diamond": "\uE0B4 ", - "type": "python" + "background_templates": [ + "{{ if empty .Full }}p:c-project-generic-error{{ else }}p:c-project-python{{ end }}" + ] }, { + "properties": { + "cache_duration": "none" + }, + "template": "❯", + "type": "text", "style": "plain", "foreground_templates": [ "{{ if eq \"False\" (title (default \"False\" .Env.ENABLE_ARROW_DIVIDER_COLOR_EXECUTION_RETURN)) }}p:c-badge-white{{ else }}{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}{{ end }}" - ], - "template": "\u276F", - "type": "text" + ] } ], - "type": "prompt" + "newline": true } ], - "console_title_template": "{{ if .Segments.Session.SSHSession }}SSH'd{{ if or .Root }} & {{ end }}{{ end }}{{ if .Root }}# (as {{ .UserName }}) | {{ end }}{{ if .WSL }}WSL | {{ end }}{{ .Folder }} ({{ .Shell }})", - "final_space": true, - "palette": { - "c-badge-folder": "#FFD770", - "c-badge-text": "#212121", - "c-badge-white": "#FAFAFA", - "c-badge-return-custom": "#E7B9FF", - "c-badge-return-fail-term": "#FF8A80", - "c-badge-return-success": "#B2FF59", - "c-battery-15-less": "#FF8A80", - "c-battery-30-less": "#FFD180", - "c-battery-45-less": "#FFE57F", - "c-battery-55-less": "#FFFF8D", - "c-battery-70-less": "#F4FF81", - "c-battery-90-less": "#B9F6CA", - "c-battery-100-less": "#CCFF90", - "c-battery-state-error": "#FF867F", - "c-date-time-morning": "#FFFF8D", - "c-date-time-noon": "#FFF64F", - "c-date-time-afternoon": "#FFC400", - "c-date-time-evening": "#C0CFFF", - "c-date-time-night": "#83B9FF", - "c-exec-fast": "#C6FF00", - "c-exec-normal": "#FFFF00", - "c-exec-slow": "#FFD180", - "c-exec-slower": "#FF867F", - "c-git-ahead": "#6EFFFF", - "c-git-behind": "#FFA06D", - "c-git-ahead-behind": "#C0CFFF", - "c-git-normal": "#66FFA6", - "c-git-staging": "#FFD740", - "c-git-staging-working": "#FFB2FF", - "c-git-upstream-gone": "#FF867F", - "c-git-working": "#84FFFF", - "c-project-generic-error": "#FF867F", - "c-project-crystal": "#FFFFFF", - "c-project-flutter": "#6DC2FF", - "c-project-lua": "#BBC2FF", - "c-project-node": "#9CFF57", - "c-project-rust": "#FFAB40", - "c-project-python": "#FFE873", - "c-secondary-ellipsis": "#FFFF8D", - "c-shell-state-ssh-active": "#BAFFFF", - "c-shell-state-root-active": "#9FFFE0", - "c-shell-state-root-ssh-active": "#FFB2FF", - "c-wakatime-undertime": "#A7FFEB", - "c-wakatime-warm-up": "#FFFFB3", - "c-wakatime-working": "#FFD180", - "c-wakatime-quota": "#FFD0B0", - "c-wakatime-overtime": "#FF8A80" - }, - "transient_prompt": { - "template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT)) }}<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B6\uF55D \uE0B1 {{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}\uFA1E {{ .Segments.Executiontime.FormattedMs }} \uE621 {{ end }}{{ end }}{{ if eq .Code 0 }}OK{{ else if eq .Code 1 }}FAIL{{ else if eq .Code 130 }}TERM{{ else }}Code{{ end }} ({{ .Code }})<{{ if eq .Code 0 }}p:c-badge-return-success{{ else if or (eq .Code 1) (eq .Code 130) }}p:c-badge-return-fail-term{{ else }}p:c-badge-return-custom{{ end }}>\uE0B4 {{ end }}\u276F " - }, - "secondary_prompt": { - "background": "transparent", - "foreground": "p:c-secondary-ellipsis", - "template": " ... " - }, - "version": 2 + "version": 3, + "final_space": true } From 2b7567265232c157f51d6fa7af71b9465fa448d1 Mon Sep 17 00:00:00 2001 From: Janrey Licas Date: Sun, 10 Nov 2024 18:41:13 +0800 Subject: [PATCH 13/13] fix(git::single-width): `branch_ahead` and `branch_behind` --- chips.omp.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chips.omp.json b/chips.omp.json index c32a503..10e853b 100644 --- a/chips.omp.json +++ b/chips.omp.json @@ -85,8 +85,8 @@ }, { "properties": { - "branch_ahead_icon": " \ue621 \uf9ac ", - "branch_behind_icon": " \ue621 \uf9ad ", + "branch_ahead_icon": " \ue621 \udb81\udcad ", + "branch_behind_icon": " \ue621 \udb81\udcae ", "branch_gone_icon": " \ue621 \uf00d", "branch_icon": "\ue0a0 ", "branch_identical_icon": " \ue621 \uf00c",