Skip to content

Hamza-CHICHI/ohmyposh-custom-themes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My "oh-my-posh" Custom Theme : EnergY

Preview

This is a preview of my Windows Terminal with my custom Oh-My-Posh theme

Windows Powershell

windows-terminal

Windows WSL/Ubuntu

ubuntu-terminal

It can also be integrated with vs code terminal too !!

vscode-terminal

Windows Powershell : Installation and setup

Nerd Font

Personally, I use both JetBrainsMono font and the Hack font

oh-my-posh CLI

  • Install the official Windows Terminal from microsoft store (for best experience)

  • Open the terminal and install oh-my-posh.exe and themes 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

Profile setup up

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

Windows WSL/Ububtu : Installation and setup

  • 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

About

My "oh-my-posh" Custom Theme : EnergY

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published