Skip to main content

Linux

Setup your terminal#

Oh my Posh uses ANSI color codes under the hood, these should work in every terminal, but you may have to set the environment variable $TERM to xterm-256color for it to work.

Installation#

sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh

Download the themes#

mkdir ~/.poshthemes
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.json
rm ~/.poshthemes/themes.zip

Preview the themes#

for file in ~/.poshthemes/*.omp.json; do echo "$file\n"; oh-my-posh --config $file --shell universal; echo "\n"; done;

Replace your existing prompt#

info

If you have no idea which shell you're currently using, Oh my Posh has a utility switch that can you tell you (not relevant for the Powershell module).

oh-my-posh --print-shell

Edit $PROFILE in your preferred PowerShell version and add the following line.

Invoke-Expression (oh-my-posh --init --shell pwsh --config ~/mytheme.omp.json)

Once added, reload your profile for the changes to take effect.

. $PROFILE

Customize#

At this point you're good to go. The jandedobbeleer.omp.json theme displays most common use-cases in your prompt so 9/10 you'll be more than happy with it. However, if you want to explore additional functionality, going through the additional steps below will help you get started.

Change the theme#

We downloaded all the themes and set jandedobbeleer.omp.json as the one to use. However, there are a lot more to be discovered and maybe there are some you like better.

Override the theme settings#

Maybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you want to tweak/add, or replace some of the icons with a different one. Whatever the case, read through all available options first, by starting with the configuration guide.

You can output the current theme to the format you like (json, yaml or toml) which can be used to tweak and store as your custom theme.

Export-PoshTheme -FilePath ~/.mytheme.omp.json -Format json

Once you're done editing, adjust your $PROFILE to use your newly created theme.

Invoke-Expression (oh-my-posh --init --shell pwsh --config ~/mytheme.omp.json)

๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰