Skip to content

Instantly share code, notes, and snippets.

@bfritscher
Created August 15, 2023 15:11
Show Gist options
  • Save bfritscher/02a506b61f2fd719ab572d3293cba390 to your computer and use it in GitHub Desktop.
Save bfritscher/02a506b61f2fd719ab572d3293cba390 to your computer and use it in GitHub Desktop.
Oh My Posh custom theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#003543",
"foreground": "#fff",
"powerline_symbol": "\ue0b0",
"properties": {
"windows": "\ue62a "
},
"style": "powerline",
"template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}}",
"type": "os"
},
{
"background": "#0087D8",
"foreground": "#003544",
"powerline_symbol": "\ue0b0",
"properties": {
"folder_separator_icon": "/",
"style": "full"
},
"style": "powerline",
"template": " \ue5ff {{ .Path }} ",
"type": "path"
},
{
"background": "#d2ff5e",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}",
"{{ if gt .Ahead 0 }}#89d1dc{{ end }}",
"{{ if gt .Behind 0 }}#f17c37{{ end }}"
],
"foreground": "#193549",
"powerline_symbol": "\ue0b0",
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "powerline",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "#fff",
"style": "plain",
"template": " \u26a1 ",
"type": "root"
},
{
"foreground": "#0087D8",
"style": "plain",
"template": "\u276f ",
"type": "text"
}
],
"type": "prompt"
}
],
"console_title_template": "{{.UserName}}@{{.HostName}} in {{ .PWD }}",
"final_space": true,
"version": 2
}
@bfritscher
Copy link
Author

Installation

  1. install oh-my-posh from windows store or via winget
  2. install a nerf font https://ohmyposh.dev/docs/installation/fonts (configure vscode and windows terminal)
  3. Create a profile:
    • New-Item -Path $PROFILE -Type File -Force
    • notepad $PROFILE
    • add this content
    oh-my-posh init pwsh --config 'https://gist.githubusercontent.com/bfritscher/02a506b61f2fd719ab572d3293cba390/raw/47451748c74060030078a002ed9bb064e4236818/mytheme.omp.json' | Invoke-Expression
    

see https://ohmyposh.dev/docs/installation/customize for more options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment