Skip to content

v-amorim/oh-my-posh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

Oh My Posh

This is my custom theme journey for Oh My Posh, a prompt theming engine for any shell.

Moonlight is my proudly crafted theme, it has a set of customizations and it is a theme that make me feel at home.

posh_main

All segments and features displayed

posh_detailed

Segments, in order:

  • Auxiliar 1st row:
    • Battery: displays an icon with the current battery, it changes based on 20%'s steps, then almost empty and full.
    • Root: Icon displayed if the user is root/superuser/administrator.
    • Upgrade: Icon displayed if there are updates to Oh My Posh available.
    • Session: Icon displayed if the user is connected via SSH.
    • Python: Icon displayed if there's an active Python virtual environment.
    • Docker: Icon and image context are displayed if Docker is running.
    • Status: Icon and error details are displayed if the last command failed.
  • Main Row:
    • OS: Icon changes based on OS, also contains a magic URL if clicked.
    • Time: Displays the current time.
    • Execution Time: Displays the time it took to execute the last command, with a 500ms threshold.
    • Git: Displays the current branch, changes based on the status of the repository.
      • Icons inside brackets:
        1. Icon displayed if there are changes in the working directory (untracked or modified files) or if there are changes staged for the next commit.
        2. Icon displayed if the branch has diverged (both ahead and behind the remote).
        3. Icon displayed if the local branch is ahead of the remote branch by at least one commit.
        4. Icon displayed if the local branch is behind the remote branch by at least one commit.
      • The current branch name is displayed and has a clickable URL to the repository.
    • Path: Displays the current path, with a clickable URL to open the current directory in the default file explorer. Also contains some mapped folders with set icons.
Theme timeline My theme journey, I learned a lot in the way and I feel proud of myself with how it turned out.

posh_timeline

If any are to your liking, feel free to check the other theme files in this repository, they are named to be in cronological order. Started with Bubbles Extra and kept changing ever since, now I feel that it is done (for now).

terminal_colors

Installation

A quick guide on how to set up Oh My Posh with this theme.

Windows

  1. Install Windows Terminal

  2. Install Oh My Posh:

    winget install JanDeDobbeleer.OhMyPosh -s winget
  3. Go to your WindowsPowerShell folder and paste the contents of Microsoft.PowerShell_profile.ps1 in the beginning of the file:

    code $PROFILE
  4. Paste these lines at the start of the file:

    oh-my-posh init pwsh --config 'https://raw.githubusercontent.com/v-amorim/oh-my-posh/main/themes/Moonlight.omp.json' | Invoke-Expression
    $env:VIRTUAL_ENV_DISABLE_PROMPT = 1
  5. Reload your profile:

    . $PROFILE
  6. To enable auto suggestions, run:

    Install-Module PsReadLine -Force
    Install-Module -Name Terminal-Icons -Repository PSGallery

To get the latest versions whenever there's an update, run:

winget upgrade JanDeDobbeleer.OhMyPosh -s winget
winget upgrade --all # Or this, to update all

Linux

  1. Install Oh My Posh:

    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
    sudo apt install unzip; curl -s https://ohmyposh.dev/install.sh | sudo bash -s
  2. Go to your .bashrc file:

    code ~/.bashrc
  3. Paste this line at the end:

    eval "$(oh-my-posh init bash --config 'https://raw.githubusercontent.com/v-amorim/oh-my-posh/main/themes/Moonlight.omp.json')"
  4. Reload your profile:

    source ~/.bashrc
  5. To get the latest versions whenever there's an update, run:

    curl -s https://ohmyposh.dev/install.sh | sudo bash -s

This can fix the auto update requiring sudo:

sudo chown -R $(whoami) /usr/local/bin

About

Here you will find my own Oh My Posh themes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published