JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.55k stars 2.4k forks source link

Change color of os section based on used linux distro #5754

Closed tzabbi closed 1 month ago

tzabbi commented 1 month ago

Code of Conduct

What would you like to see changed?

I love the function that oh-my-posh detects the linux distro and displays the appropiate icon. An enhancement for this would be the that the color will be changed to the main color of the linux distro. e.g. Fedora blue, Linux mint green, ....

JanDeDobbeleer commented 1 month ago

@tzabbi this is already possible using the color template functionality:

{
  "foreground_templates": [
    "{{if eq \"macos\" .OS}}#FFA400{{end}}"
  ]
}

Or palettes if you want to only define this logic once:

{
  "palettes": {
    "template": "{{ .OS }}",
    "list": {
      "macos": {
        "accent": "#262B44"      },
      "mint": {
        "accent": "#262B44"
      }
    }
  }
}