Skip to content

Oh My Posh

~/.bashrc

eval "$(oh-my-posh completion bash)"
eval "$(oh-my-posh init bash --config $HOME/.config/roy.omp.json)"

roy.omp.json

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": "<#69FF94>❯</><#C591E8>❯</><#CACA02>❯</> ",
          "foreground": "#ffffff",
          "type": "text",
          "style": "plain"
        },
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": " % ",
          "foreground": "red",
          "type": "root",
          "style": "plain"
        },
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": "<cyan>{{ .UserName }}</> <darkGray>@</> <green>{{ .HostName }}</> ",
          "type": "session",
          "style": "plain"
        },
        {
          "properties": {
            "cache_duration": "none",
            "style": "full"
          },
          "template": "<darkGray>in </>{{ .Path }} ",
          "foreground": "lightYellow",
          "type": "path",
          "style": "plain"
        },
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": "<darkGray>on</> <white>git:</>{{ .HEAD }} ",
          "type": "git",
          "style": "plain"
        },
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": "[{{ .CurrentDate | date .Format }}]",
          "foreground": "darkGray",
          "type": "time",
          "style": "plain"
        },
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": " C:{{ if gt .Code 0 }}{{ .Code }}{{ end }} ",
          "foreground": "red",
          "type": "exit",
          "style": "plain"
        }
      ],
      "newline": true
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "properties": {
            "cache_duration": "none",
            "home_enabled": true
          },
          "template": " 🐍 {{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }} ",
          "type": "python",
          "style": "plain"
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "properties": {
            "cache_duration": "none"
          },
          "template": "$",
          "foreground": "lightRed",
          "type": "text",
          "style": "plain"
        }
      ],
      "newline": true
    }
  ],
  "version": 3,
  "final_space": true
}