From ce4cb5e63c1711f207d8f1f633b6537bb77ca302 Mon Sep 17 00:00:00 2001 From: Damien Date: Sun, 21 Jun 2026 11:33:29 +0200 Subject: [PATCH] Update starship config with ContainerLab module Add custom module to display ContainerLab topology name when present in the directory --- .config/starship.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.config/starship.toml b/.config/starship.toml index 898e2b4..de906ca 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -85,3 +85,13 @@ style = 'bold fg:#E297DB' pyenv_version_name = false detect_extensions = ['py'] detect_files = ['.python-version', 'pyproject.toml', 'requirements.txt', 'setup.py', 'Pipfile'] + +# Shows if a ContainerLab topology file is present in the current directory +[custom.containerlab] +description = "Shows ContainerLab topology name when present" +command = 'grep -m1 "^name:" *.clab.y*ml 2>/dev/null | head -1 | cut -d: -f2 | xargs' +when = 'ls *.clab.yml *.clab.yaml 2>/dev/null | grep -q .' +symbol = '󰒍 ' +format = 'via [$symbol($output)]($style) ' +style = 'bold fg:#C58FFF' +shell = ['bash', '--noprofile', '--norc']