and want to install custom theme
- User
and want to install custom theme
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
and want to install custom theme
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Great! Installing a custom theme in Oh My Posh is straightforward on Ubuntu. Here's a step-by-step guide to help you create and use a custom theme.
Oh My Posh configuration uses a .json or .omp.json file.
Create a new file, e.g., mytheme.omp.json:
nano ~/.config/oh-my-posh/themes/mytheme.omp.json
Paste in this basic example:
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "os",
"style": "powerline",
"foreground": "#ffffff",
"background": "#007ACC"
},
{
"type": "path",
"style": "powerline",
"foreground": "#ffffff",
"background": "#4CAF50",
"properties": {
"style": "full"
}
},
{
"type": "git",
"style": "powerline",
"foreground": "#ffffff",
"background": "#F44336",
"properties": {
"branch_icon": "🌿"
}
}
]
},
{
"type": "rprompt",
"segments": [
{
"type": "time",
"style": "plain",
"foreground": "#999999",
"properties": {
"time_format": "15:04:05"
}
}
]
}
]
}
You can customize it more using the segment reference.
Depending on what shell you're using, you'll add Oh My Posh initialization with your custom theme path.
Edit your .bashrc
nano ~/.bashrc
Add this at the bottom:
eval "$(oh-my-posh init bash --config ~/.config/oh-my-posh/themes/mytheme.omp.json)"
Edit your .zshrc:
nano ~/.zshrc
Add this:
eval "$(oh-my-posh init zsh --config ~/.config/oh-my-posh/themes/mytheme.omp.json)"
Reload your shell:
source ~/.bashrc # for bash
or
source ~/.zshrc # for zsh
Oh My Posh themes use Nerd Font glyphs. Without these, icons may not render correctly.
Download and install a Nerd Font (e.g., Meslo):
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
curl -fLo "MesloLGS Nerd Font Regular.ttf" https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip
unzip Meslo.zip
rm Meslo.zip
fc-cache -fv
Then, set your terminal font to "MesloLGS Nerd Font" in your terminal preferences.
Run:
oh-my-posh debug --config ~/.config/oh-my-posh/themes/mytheme.omp.json
This lets you preview your custom theme and diagnose issues.
Let me know if you want a custom theme designed for your needs (e.g., minimal, battery info, Kubernetes context, etc.) – I can help!