Oh My Posh Notes
Resources
Section titled “Resources”- Oh My Posh
- JanDeDobbeleer/oh-my-posh
- My Ultimate PowerShell prompt with Oh My Posh and the Windows Terminal
Windows Installation
Section titled “Windows Installation”-
Install/Update:
PS> Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1')) -
Install a Nerd Font:
PS> oh-my-posh font install meslo -
Windows Terminal settings (
profiles:defaults:font:face = "MesloLGM NerdFont") -
Copy .mytheme.omp.json to
$env:UserProfile- Alternatively ohmyposhv3_v2.json by Scott Hanselman
-
Add this line to
$env:UserProfile\Documents\PowerShell\profile.ps1:PS> oh-my-posh init pwsh --config "~/.mytheme.omp.json" | Invoke-Expression -
Enable the reload feature to immediately see changes made to
~/.mytheme.omp.json:PS> oh-my-posh enable reload
Linux Installation
Section titled “Linux Installation”-
Make sure these tools are installed - curl, unzip, realpath, dirname:
sudo apt install curlsudo dnf install curl -
Install the latest version for your system:
curl -s https://ohmyposh.dev/install.sh | bash -s -
If it warns that
~/.local/binis not in the PATH, add this to.bashrc:export PATH=$PATH:/home/<username>/.local/bin -
Install Nerd Fonts:
oh-my-posh font install meslo -
Configure the terminal to use MesloLGM Nerd Font:
- Gnome:
- Right-Click Terminal in Dash → Preferences → “Unnamed” Profile → Text → check “Custom font” → select “MesloLGM Nerd Font”
- KDE (Konsole):
Ctrl-Shift-,→ Profiles → New… → General → “Oh My Posh Profile” → check “Default profile” → Apply → Appearance → Font Choose → “MesloLGM Nerd Font” → OK → OK → restart Konsole
- Gnome:
-
Add this to ~/.bashrc:
eval "$(oh-my-posh init bash --config '~/.mytheme.omp.json')" -
(optional) Enable live reloading:
oh-my-posh enable reload