Struggling with conditional diamond for rprompt #4656
Answered
by
JanDeDobbeleer
mu88
asked this question in
Troubleshoot
-
Hi 👋🏻 First of all, thank you for this amazing project and your work! I'm having trouble with configuring the right side (
Please see my following attempts regarding goal 2, whereas I've no idea yet how to fulfill goal 1. Attempt 1Config: "segments": [
{
"type": "dotnet",
"style": "diamond",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0b2",
"foreground": "#ffffff",
"background": "#6CA35E",
"template": " {{ .Full }} "
},
{
"background": "#2e9599",
"foreground": "#111111",
"leading_diamond": "\ue0b6",
"properties": {
"time_format": "_2, 15:04:05"
},
"style": "diamond",
"template": " \uf073 {{ .CurrentDate | date .Format }} ",
"trailing_diamond": "\ue0b4",
"type": "time"
}
],
"type": "rprompt" Attempt 2Config: "segments": [
{
"type": "dotnet",
"style": "diamond",
"leading_diamond": "\ue0b6",
"foreground": "#ffffff",
"background": "#6CA35E",
"template": " {{ .Full }} "
},
{
"background": "#2e9599",
"foreground": "#111111",
"invert_powerline": true,
"leading_diamond": "\ue0b2",
"properties": {
"time_format": "_2, 15:04:05"
},
"style": "diamond",
"template": " \uf073 {{ .CurrentDate | date .Format }} ",
"trailing_diamond": "\ue0b4",
"type": "time"
}
],
"type": "rprompt" Attempt 3Config: "segments": [
{
"type": "dotnet",
"style": "diamond",
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0b2",
"foreground": "#ffffff",
"background": "#6CA35E",
"template": " {{ .Full }} "
},
{
"background": "#2e9599",
"foreground": "#111111",
"properties": {
"time_format": "_2, 15:04:05"
},
"style": "diamond",
"template": " \uf073 {{ .CurrentDate | date .Format }} ",
"trailing_diamond": "\ue0b4",
"type": "time"
}
],
"type": "rprompt" Thank you very much for your help! |
Beta Was this translation helpful? Give feedback.
Answered by
JanDeDobbeleer
Feb 6, 2024
Replies: 1 comment 5 replies
-
This is what you need: "segments": [
{
"type": "dotnet",
"style": "diamond",
"leading_diamond": "\ue0b6",
"foreground": "#ffffff",
"background": "#6CA35E",
"template": " {{ .Full }} "
},
{
"background": "#2e9599",
"foreground": "#111111",
"properties": {
"time_format": "_2, 15:04:05"
},
"style": "diamond",
"template": " \uf073 {{ .CurrentDate | date .Format }} ",
"leading_diamond": "<background,parentBackground>\ue0b6</>",
"trailing_diamond": "\ue0b4",
"type": "time"
}
],
"type": "rprompt" |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mu88 I don't have the behaviour from the second screenshot BTW. That said, this is a very advanced question, but it can be achieved using a plain segment instead of diamond for the time segment: