Skip to content

Commit

Permalink
fix(themes): adjust themes for correct rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Feb 15, 2024
1 parent fece104 commit 9e7237a
Show file tree
Hide file tree
Showing 18 changed files with 652 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/cli/config_export_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Exports the config to an image file using customized output options.`,
// set sane defaults for things we don't print
cfg.ConsoleTitleTemplate = ""
cfg.PWD = ""
cfg.OSC99 = false

// add variables to the environment
env.Var = cfg.Var
Expand Down
4 changes: 3 additions & 1 deletion src/engine/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"math"
"os"
"path/filepath"
"slices"
"strconv"
"strings"
"unicode/utf8"
Expand Down Expand Up @@ -327,7 +328,8 @@ var doubleWidthRunes = []RuneRange{
// Nerd Font glyphs will return 1, since most are double width
func (ir *ImageRenderer) runeAdditionalWidth(r rune) int {
// exclude the round leading diamond
if r == '\ue0b6' {
singles := []rune{'\ue0b6', '\ue0ba', '\ue0bc'}
if slices.Contains(singles, r) {
return 0
}

Expand Down
2 changes: 1 addition & 1 deletion themes/avit.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{
"foreground": "#007ACC",
"style": "plain",
"template": "\ue602 ",
"template": "\ue602",
"type": "text"
}
],
Expand Down
8 changes: 5 additions & 3 deletions themes/blue-owl.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@
"background": "#29315A",
"foreground": "#43CCEA",
"leading_diamond": "\ue0c5",
"trailing_diamond": "\ue0bc",
"style": "diamond",
"template": " {{ .UserName }}<transparent> / </>{{ .HostName }}",
"template": " {{ .UserName }}<transparent> / </>{{ .HostName }} ",
"type": "session"
},
{
Expand All @@ -92,8 +93,9 @@
"properties": {
"time_format": "15:04:05"
},
"style": "plain",
"template": "<transparent> \ue0ba\ue0bc </>{{ .CurrentDate | date .Format }} ",
"leading_diamond": "\ue0ba",
"style": "diamond",
"template": " {{ .CurrentDate | date .Format }} ",
"type": "time"
}
],
Expand Down
8 changes: 2 additions & 6 deletions themes/chips.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@
"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": "{{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uE0B1 \uF448 ({{ .Working.String }}){{ end }}{{ if and .Working.Changed .Staging.Changed }} \uE0B1 {{ end }}{{ if .Staging.Changed }}{{ if not .Working.Changed }} \uf15c {{ end }}\uf15c ({{ .Staging.String }}){{ end }}{{ if .StashCount }} \ueb4b {{ .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
},
Expand Down Expand Up @@ -108,7 +104,7 @@
"time_format": "15:04 (01/02)"
},
"style": "diamond",
"template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uF5EF {{ .CurrentDate | date .Format }}{{ end }}",
"template": "{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_DTIME)) }}\uf43a {{ .CurrentDate | date .Format }}{{ end }}",
"trailing_diamond": "\uE0B4 ",
"type": "time"
},
Expand Down
2 changes: 1 addition & 1 deletion themes/glowsticks.omp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ blocks:
style: diamond
template: " {{ if gt .Code 0 }} {{ reason .Code }}{{ else }}{{ end }} "
trailing_diamond:
type: exit
type: status
type: prompt
- alignment: right
segments:
Expand Down
2 changes: 1 addition & 1 deletion themes/if_tea.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"properties": {
"folder_icon": "\uf07b ",
"folder_separator_icon": " \uf061 ",
"home_icon": "",
"home_icon": "\uf46d",
"style": "agnoster_full",
"template": " \ue5ff {{ .Path }} "
},
Expand Down
7 changes: 4 additions & 3 deletions themes/jonnychipz.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
{
"background": "#1a1af5",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",
"style": "powerline",
"trailing_diamond": "\ue0b0",
"style": "diamond",
"template": " \uebd8 {{ .Name }} ",
"type": "az"
},
Expand All @@ -38,7 +38,8 @@
"always_enabled": true
},
"style": "diamond",
"template": "<transparent>\ue0b0</>\ue23a ",
"template": " \ue23a ",
"leading_diamond": "<transparent>\ue0b0</>",
"trailing_diamond": "\ue0b4",
"type": "status"
}
Expand Down
4 changes: 2 additions & 2 deletions themes/json.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"style": "folder"
},
"style": "diamond",
"template": "<#42E66C>\u2B22 </><b>{{ .Path }}</b>",
"template": "<#42E66C>\ueaf7 </><b>{{ .Path }}</b>",
"type": "path"
},
{
Expand All @@ -36,7 +36,7 @@
"newline": true,
"segments": [
{
"foreground": "#000000",
"foreground": "#FFFFFF",
"style": "plain",
"template": ">",
"type": "text"
Expand Down
2 changes: 1 addition & 1 deletion themes/kali.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"always_enabled": true
},
"style": "plain",
"template": " {{ if gt .Code 0 }}\u2a2f{{else}}\u2713{{ end }} ",
"template": " {{ if gt .Code 0 }}\uea76{{else}}\uf42e{{ end }} ",
"type": "status"
}
],
Expand Down
2 changes: 1 addition & 1 deletion themes/lightgreen.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "root"
},
{
"background": "#000000",
"background": "transparent",
"foreground": "#ffffff",
"properties": {
"alpine": "\uf300",
Expand Down
2 changes: 1 addition & 1 deletion themes/neko.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
}
],
"version": 2
}
}
2 changes: 1 addition & 1 deletion themes/night-owl.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"foreground": "#337bb6",
"leading_diamond": "\ue0b2",
"style": "diamond",
"template": "\uFD03 {{ .EnvironmentName }} ",
"template": "\uebd8 {{ .EnvironmentName }} ",
"trailing_diamond": "<transparent,#ffffff>\ue0b2</>",
"type": "az"
},
Expand Down
4 changes: 2 additions & 2 deletions themes/pixelrobots.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"fetch_upstream_icon": true
},
"style": "diamond",
"template": "<#ffea00>\ue0b1 </>{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}<#E84855> \uf044 {{ .Working.String }}</>{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#2FDA4E> \uf046 {{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ",
"template": "<#ffea00>\ue0b1 </>{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}<#E84855> \uf044 {{ .Working.String }}</>{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#2FDA4E> \uf046 {{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
"type": "git"
},
{
Expand Down Expand Up @@ -153,4 +153,4 @@
"console_title_template": "{{if .Root}}root :: {{end}}{{.Shell}} :: {{.Folder}}",
"final_space": true,
"version": 2
}
}
2 changes: 1 addition & 1 deletion themes/powerlevel10k_rainbow.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"always_enabled": true
},
"style": "powerline",
"template": " {{ if gt .Code 0 }}{{ reason .Code }}{{ else }}\u2714{{ end }} ",
"template": " {{ if gt .Code 0 }}{{ reason .Code }}{{ else }}\uf42e{{ end }} ",
"type": "status"
},
{
Expand Down
6 changes: 3 additions & 3 deletions themes/smoothie.omp.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{
"foreground": "#ffaed8",
"properties": {
"folder_separator_icon": " 🢖 ",
"home_icon": "\u2764",
"folder_separator_icon": " | ",
"home_icon": "\uf46d",
"style": "letter"
},
"style": "plain",
Expand All @@ -25,7 +25,7 @@
{
"foreground": "#62beff",
"properties": {
"branch_icon": "\u27df",
"branch_icon": "\uf418",
"branch_identical_icon": "\u2261",
"fetch_status": true
},
Expand Down
2 changes: 1 addition & 1 deletion website/docs/segments/az.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Config from '@site/src/components/Config.js';
"powerline_symbol": "\uE0B0",
"foreground": "#000000",
"background": "#9ec3f0",
"template": " \uFD03 {{ .EnvironmentName }}"
"template": " \uebd8 {{ .EnvironmentName }}"
}}/>

## Properties
Expand Down
Loading

0 comments on commit 9e7237a

Please sign in to comment.