From 82b4a638e869103d45f7675792f24cd3485cb977 Mon Sep 17 00:00:00 2001 From: voidarc Date: Wed, 1 Apr 2026 20:22:42 +0100 Subject: [PATCH] made the weird flake thing dynamic --- .config/oh-my-posh/zen.toml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.config/oh-my-posh/zen.toml b/.config/oh-my-posh/zen.toml index 7c737f45..14fae613 100644 --- a/.config/oh-my-posh/zen.toml +++ b/.config/oh-my-posh/zen.toml @@ -17,23 +17,22 @@ final_space = true alignment = 'left' newline = true - [[blocks.segments]] - type = 'text' - style = 'plain' - foreground = '#89dceb' # Nix Blue - template = '{{ if hasPrefix "flake-" .Env.name }}󱄅 flake <#7f849c>| {{ end }}' - - [[blocks.segments]] # Rust nix shell - type = 'text' - style = 'plain' - foreground = 'red' - template = '{{ if contains "rustshell-env" .Env.name }}🦀 rustproject <#7f849c>| {{ end }}' - - [[blocks.segments]] # Python venv - type = 'text' - style = 'plain' - foreground = 'yellow' - template = '{{ if .Env.VIRTUAL_ENV }}🐍 venv | {{ end }}' +[[blocks.segments]] +type = 'text' +style = 'plain' +template = ''' +{{- if .Env.DEVSHELL_NAME -}} + {{- $parts := split "|" .Env.DEVSHELL_NAME -}} + {{- range $part := $parts -}} + {{- if $part -}} + {{- $sub := split "/" $part -}} + {{- if eq (len $sub) 2 -}} + <{{ index $sub "_1" }}>{{ index $sub "_0" }} <#7f849c>| + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} +''' [[blocks.segments]] template = '{{ .Path }}'