How do I add a space or transparent whitespace after each segment with style diamond? #4913
Replies: 2 comments
-
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#c386f1",
"foreground": "#000000",
"leading_diamond": "\ue0b6",
"style": "diamond",
"template": " {{ .UserName }} ",
"trailing_diamond": "\ue0b0",
"type": "session"
},
{
"background": "#ff479c",
"foreground": "#000000",
"properties": {
"home_icon": "~",
"style": "folder"
},
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": " \uea83 {{ .Path }} ",
"type": "path"
},
{
"background": "#fffb38",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
],
"foreground": "#193549",
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"properties": {
"branch_max_length": 25,
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
"type": "git"
},
{
"background": "#ffff66",
"foreground": "#111111",
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": " \uf0ad ",
"type": "root"
},
{
"background": "#B4A2D6",
"foreground": "#000000",
"properties": {
"always_enabled": true
},
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": " {{ .FormattedMs }} ",
"type": "executiontime"
},
{
"background": "#23E9A4",
"background_templates": [
"{{ if gt .Code 0 }}#e91e63{{ end }}"
],
"foreground": "#000000",
"properties": {
"always_enabled": true
},
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": "<parentBackground></> \ue23a ",
"type": "status"
},
{
"background": "#0077c2",
"foreground": "#000000",
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": " {{ .Name }} ",
"type": "shell"
},
{
"background": "#1BD760",
"foreground": "#111111",
"properties": {
"paused_icon": "\uf04c ",
"playing_icon": "\uf04b "
},
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": " \uf167 {{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }} ",
"type": "ytm"
},
{
"background": "transparent",
"foreground": "#ffffff",
"invert_powerline": true,
"style": "diamond",
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b0",
"template": " {{ .CurrentDate | date .Format }} ",
"type": "time"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"style": "plain",
"template": "\u2570\u2500",
"type": "text"
}
],
"type": "prompt"
}
],
"console_title_template": "{{ .Shell }} in {{ .Folder }}",
"final_space": false,
"version": 2
} |
Beta Was this translation helpful? Give feedback.
-
|
{ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So I just installed oh my posh and my shell is ZSH, I am trying to figure out how can I add spaces after each segment
As you can see, there is no space after username, path and execution time. I tried to figure out to add whitespace after execution time and status but it just comes out weird.
I am still just playing around with the code and just playing around with the JanDeDobbeleer.omp.json theme and this is what the modified code looks like.
Beta Was this translation helpful? Give feedback.
All reactions