This is a preview of my Windows Terminal with my custom Oh-My-Posh theme
It can also be integrated with vs code terminal too !!
-
Download the zip of any nerd font that you like from the github release page, extract it and install it to you machine :
Personally, I use both JetBrainsMono font and the Hack font
-
Install the official Windows Terminal from microsoft store (for best experience)
-
Open the terminal and install
oh-my-posh.exe
andthemes
via Via WinGet
winget install JanDeDobbeleer.OhMyPosh -s winget
- Check if oh-my-posh is working by chosing the default theme
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression
Add a profile, so that everytime you launch the terminal, the theme should be loaded and ready.
- Add my custom theme
energy.omp.json
to the oh-my-posh theme directory, you can get the oh-my-posh theme direcotry path by running :
Get-ChildItem ENV:POSH_THEMES_PATH
Name Value
---- -----
POSH_THEMES_PATH C:\...\oh-my-posh\themes
- Set PowerShell to only require remote scripts to be signed :
New-Item -Path $PROFILE -Type File -Force
- Edit your PowerShell profile script using notepad :
notepad $PROFILE
- Add the following line to your notepad :
oh-my-posh init pwsh --config '$env:POSH_THEMES_PATH\energy.omp.json' | Invoke-Expression
- Restart you terminal, if this doesn't work, try adding an exception to your Antivirus as stated by the oh-my-posh documentation :
& ([ScriptBlock]::Create((oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\energy.omp.json" --print) -join "`n"))
- Now your Windows terminal should look new and clean !
For more details, refer to the oh-my-posh doc Windows installation : https://ohmyposh.dev/docs/installation/windows
-
Install the WSL Ubuntu terminal from microsoft store
-
Install
unzip
as is it required for oh-my-posh installation
apt install unzip
- Install oh-my-posh CLI
curl -s https://ohmyposh.dev/install.sh | bash -s
- Install a Nerd Font with Oh My Posh has CLI ( for me I installed the JetBrains Mono font)
oh-my-posh font install JetBrainsMono
-
Choose this font from your teminal windows settings
- Settings > Profile > Default > Scroll to Apparence > Police type > And choose your favorite nerd font that you downloaded
- This step is optional :
- You can import my settings from this repo settings.json and apply it to you Windows terminal by going to Settings > Bottom left > Open Json File > And Paste my json
⚠️ Make a backup of your settings.json first
- Configure your shell to use Oh My Posh
eval "$(oh-my-posh init bash)"
- Create the oh my posh theme directory and downloand the energy theme
mkdir ~/.poshthemes
cd ~/.poshthemes
wget https://raw.githubusercontent.com/Hamza-CHICHI/ohmyposh-custom-themes/main/energy.omp.json
- Now apply the theme
eval "$(oh-my-posh init bash --config ~/.poshthemes/energy.omp.json)"
- If everything is working correcty added it to your profile so next time it loads automatically
## Apply
echo 'eval "$(oh-my-posh init bash --config ~/.poshthemes/energy.omp.json)"' >> ~/.bashrc
## Restart bash
exec bash
For more details, refer to the oh-my-posh doc Linux installation : https://ohmyposh.dev/docs/installation/linux