Coder Social home page Coder Social logo

oh-my-posh's Introduction

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

oh-my-posh's People

Contributors

v-amorim avatar

Stargazers

David Dennison avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.