# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
blocks:
  - alignment: left
    segments:
      # Session
      - background: p:black
        foreground: p:white
        invert_powerline: true
        powerline_symbol: 
        style: powerline
        template: "{{ .UserName }}@{{ .HostName }} "
        type: session

      # Path
      - background: p:orange
        foreground: p:white
        powerline_symbol: 
        options:
          home_icon: ""
          style: folder
        style: powerline
        template: "  {{ .Path }} "
        type: path

      # Execution time
      - background: p:darkred
        foreground: p:white
        powerline_symbol: 
        options:
          always_enabled: true
          style: round
        style: powerline
        template: " 󰔟{{ .FormattedMs }} "
        type: executiontime

      # Exit code
      - background: p:blue
        background_templates:
          - "{{ if gt .Code 0 }}p:red{{ end }}"
        foreground: p:white
        powerline_symbol: 
        options:
          always_enabled: true
        style: diamond
        template: " {{ if gt .Code 0 }} {{ reason .Code }}{{ else }}{{ end }} "
        trailing_diamond: 
        type: status
    type: prompt
  - alignment: right
    segments:
      # Shell
      - background: p:black
        foreground: p:white
        style: plain
        template: <p:black,transparent></> {{ .Name }}<transparent,p:black></>
        type: shell

      # Battery
      - background_templates:
          - '{{if eq "Charging" .State.String }}p:green{{end}}'
          - '{{if eq "Discharging" .State.String}}p:orange{{end}}'
        foreground: p:white
        leading_diamond: 
        options:
          charged_icon: 󰂄
          charging_icon: 󰂄
          discharging_icon: "󰁹 "
        style: diamond
        template: " {{.Templates }}{{ .Percentage}}󰏰 <transparent></>"
        templates:
          - '{{if eq "Discharging" .State.String}}{{if lt .Percentage 11}}󰁺{{else if lt .Percentage 21}}󰁻{{else if lt .Percentage 31}}󰁼{{else if lt .Percentage 41}}󰁽{{else if lt .Percentage 51}}󰁾{{else if lt .Percentage 61}}󰁾{{else if lt .Percentage 71}}󰂀{{else if lt .Percentage 81}}󰂁{{else if lt .Percentage 91}}󰂂{{else}}󰁹{{end}}{{end}}'
          - '{{if eq "Charging" .State.String}}{{ if lt .Percentage 21}}󰂆{{else if lt .Percentage 31}}󰂇{{else if lt .Percentage 41}}󰂈{{else if lt .Percentage 61}}󰂉{{else if lt .Percentage 81}}󰂊{{else if lt .Percentage 91}}󰂋{{else}}󰂄{{end}}{{end}}'
        templates_logic: first_match
        type: battery
    type: rprompt
final_space: true
console_title_template:  {{ .Shell }} in {{ if ne .Folder "~"}} {{ .Folder }}{{else}}{{end}}
palette:
  black: "#33395b"
  blue: "#359ddd"
  darkred: "#7c0a16"
  green: "#277b48"
  orange: "#ff972e"
  red: "#de3142"
  white: "#efeef4"
secondary_prompt:
  background: transparent
  foreground: p:white
  template: " "
transient_prompt:
  background: transparent
  foreground: p:white
  template: " "
version: 4
