Skip to content

Instantly share code, notes, and snippets.

@brucevanhorn2
Last active February 6, 2025 21:17
Show Gist options
  • Save brucevanhorn2/2710cdfd8a85f4473c1efc3b9c9c2a52 to your computer and use it in GitHub Desktop.
Save brucevanhorn2/2710cdfd8a85f4473c1efc3b9c9c2a52 to your computer and use it in GitHub Desktop.
My 1-shell oh-my-posh theme customization
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"transient_prompt": {
"template": "\u2ce9 ",
"foreground": "#FEF5ED",
"background": "transparent"
},
"console_title_template": "{{ .Folder }}",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"properties": {
"display_host": true
},
"style": "diamond",
"leading_diamond": "<#eae600> \ue201 </>",
"template": "{{ .Name }} <#ffffff>\uf101</>",
"foreground": "#eae600",
"type": "az"
},
{
"properties": {
"time_format": "Mon 3:04 PM"
},
"style": "diamond",
"template": " {{ .CurrentDate | date .Format }} ",
"foreground": "#8c44ff",
"type": "time"
},
{
"properties": {
"branch_icon": "\ue725 ",
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true,
"fetch_worktree_count": true
},
"style": "diamond",
"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 }} \ue23b {{ .StashCount }}{{ end }} ",
"foreground": "#f334c3",
"type": "git"
}
],
"newline": true
},
{
"type": "prompt",
"alignment": "right",
"segments": [
{
"style": "plain",
"foreground": "#48fe60",
"type": "text"
},
{
"properties": {
"style": "austin",
"threshold": 0
},
"style": "diamond",
"template": "<#ffffff>\u23f2</> {{ .FormattedMs }}",
"foreground": "#48fe60",
"type": "executiontime"
},
{
"properties": {
"root_icon": "\uf292 "
},
"style": "diamond",
"template": " \uf0e7 ",
"type": "root"
},
{
"style": "diamond",
"template": " <#ffffff>\uf4b3</> {{ round .PhysicalPercentUsed .Precision }}% ",
"foreground": "#48fe60",
"type": "sysinfo"
},
{
"style": "diamond",
"template": "<#ffffff>\ue266</> {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1000000000.0) }}/{{ (div .PhysicalTotalMemory 1000000000.0) }}GB ",
"foreground": "#48fe60",
"type": "sysinfo"
},
{
"properties": {
"charged_icon": "\u2622 ",
"charging_icon": "\uf583 ",
"discharging_icon": "\uf584 "
},
"style": "plain",
"template": "{{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}\uf295 ",
"foreground": "#f36943",
"type": "battery",
"foreground_templates": [
"{{ if eq \"Full\" .State.String }}#48fe60{{ end }}",
"{{ if eq \"Charging\" .State.String }}#40c4ff{{ end }}",
"{{ if eq \"Discharging\" .State.String }}#ff5722{{ end }}"
]
}
]
},
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"properties": {
"prefix": " \ue235 "
},
"style": "powerline",
"foreground": "#100e23",
"powerline_symbol": "\ue0b0",
"background": "#906cff",
"type": "python"
},
{
"properties": {
"folder_icon": "\uf07b",
"folder_separator_icon": "\uebf9",
"home_icon": "home",
"style": "agnoster_full"
},
"style": "diamond",
"leading_diamond": "<#00c7fc> \ue285 </><#0c92e6>{</>",
"trailing_diamond": "<#0c92e6>}</>",
"template": " \ue5ff {{ .Path }} ",
"foreground": "#0c92e6",
"type": "path"
},
{
"properties": {
"always_enabled": true
},
"style": "plain",
"template": " \u2ce9 ",
"foreground": "#A9FFB4",
"type": "exit",
"foreground_templates": [
"{{ if gt .Code 0 }}#ef5350{{ end }}"
]
}
],
"newline": true
}
],
"version": 3
}

1-shell oh my posh customization

This is one of my go-to Oh My Posh theme customizations. Its got most of what is in 1 shell by default:

  • Shows the current azure subscription
  • Shows the Day and Time
  • Shows CPU utilzation of last command
  • Shows Execution time of last command
  • Shows Current memory consumption
  • Shows current folder
  • Presents the ChiRho symbol as the prompt to remind me to give glory to Jesus Christ in all that I do.
@brucevanhorn2
Copy link
Author

I fixed some icons that weren't working well.

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