diff --git a/modules/home/programs/shell/oh-my-posh.nix b/modules/home/programs/shell/oh-my-posh.nix index 13be465..4b8d63c 100644 --- a/modules/home/programs/shell/oh-my-posh.nix +++ b/modules/home/programs/shell/oh-my-posh.nix @@ -14,14 +14,14 @@ in { programs.oh-my-posh = { enable = true; settings = { - version = 2; + # version = 2; final_space = true; - console_title_template = "{{ if .SSHSession }}[{{ .HostName }}] {{ end }}{{ .Shell }} in {{ .Folder }}"; + shell_integration = true; + console_title_template = "{{if .SSHSession}}{{.HostName}} {{ end }}{{ .Shell }} in {{ .Folder }}"; blocks = [ { type = "prompt"; alignment = "left"; - newline = true; segments = [ { type = "path"; @@ -57,14 +57,35 @@ in { fetch_status = true; }; } + ]; + } + { + type = "rprompt"; + overflow = "hidden"; + newline = true; + segments = [ { type = "session"; - style = "diamond"; + style = "plain"; foreground = "white"; background = "transparent"; - leading_diamond = ""; - trailing_diamond = ""; - template = "{{ if .SSHSession }} 󰢹 {{ .UserName }}@{{ .HostName }}{{ end }}"; + template = "{{ if .SSHSession }} {{ .UserName }}@{{ .HostName }} {{ end }}"; + } + { + type = "connection"; + template = "{{ if eq .Type \"wifi\"}} 󰖩 {{ else if eq .Type \"ethernet\"}} 󰈁 {{ else }} 󰈂{{ end }}"; + } + { + style = "plain"; + foreground = "white"; + background = "transparent"; + properties = { + charged_icon = "󰁹"; + charging_icon = "󱟡"; + discharging_icon = "󱟟"; + }; + template = "{{ if not .Error }} {{ .Icon }} {{ .Percentage }}% {{ end }}"; + type = "battery"; } ]; } @@ -92,22 +113,22 @@ in { { type = "text"; style = "plain"; - foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"]; + foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}green{{end}}"]; background = "transparent"; - template = "❯"; + template = ">"; } ]; } ]; transient_prompt = { - foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"]; + foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}green{{end}}"]; background = "transparent"; - template = "❯ "; + template = "> "; }; secondary_prompt = { - foreground = "magenta"; + foreground = "green"; background = "transparent"; - template = "❯❯ "; + template = ">> "; }; }; };