DEV Community

Cover image for Posh2K - A universal prompt for power users 💪🌈
Abhishek Keshri
Abhishek Keshri

Posted on • Edited on • Originally published at 2kabhishek.github.io

Posh2K - A universal prompt for power users 💪🌈

What is this

Posh2K is a prompt for oh-my-posh, it works on all shells, has multiple segments with aesthetically pleasing colors.

Inspiration

Most of my workflow is based on the command line, recently I had to use a Windows system for some work and was really displeased by the CLI experience.

So, I needed a prompt that can work across shells and has support for different segments and Posh2K was born.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of oh-my-posh

Getting Posh2K

To get Posh2K, follow these steps:



git clone https://github.com/2kabhishek/Posh2K

# for Powershell, add this to $Profile
oh-my-posh init pwsh --config ~/PATH_TO_DIR/Posh2K/posh2k.omp.json | Invoke-Expression

# for Zsh, add this to ~/.zshrc
eval "$(oh-my-posh init zsh --config ~/PATH_TO_DIR/Posh2K/posh2k.omp.json)"

# for Bash, add this to ~/.bashrc
eval "$(oh-my-posh init bash --config ~/PATH_TO_DIR/Posh2K/posh2k.omp.json)"

# for Fish, add this to ~/config/fish/config.fish
oh-my-posh init fish --config ~/PATH_TO_DIR/Posh2K/posh2k.omp.json | source

# for nu shell, run
oh-my-posh init nu --config ~/PATH_TO_DIR/Posh2K/posh2k.omp.json
source ~/oh-my-posh.nu

# for cmd, install Clink, then add this
load(io.popen('oh-my-posh init cmd --config ~/PATH_TO_DIR/Posh2K/posh2k.omp.json'):read("*a"))()



Enter fullscreen mode Exit fullscreen mode

Repo

GitHub logo 2KAbhishek / posh2k

Universal prompt for Power users 💪🌈


License


People


Stars


Forks


Watches


Last Updated

Universal prompt for Power users 💪🌈

posh2k Demo


posh2k screenshot

What is this

posh2k is a prompt for oh-my-posh, it works on all shells, has multiple segments with aesthetically pleasing colors.

Inspiration

Most of my workflow is based on the command line, recently I had to use a Windows system for some work and was really displeased by the CLI experience.

So, I needed a prompt that can work across shells and has support for different segments and posh2k was born.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of oh-my-posh

Getting posh2k

To get posh2k, follow these steps:

git clone https://github.com/2kabhishek/posh2k
# for Powershell, add this to $Profile
oh-my-posh init pwsh --config ~/PATH_TO_DIR/posh2k/posh2k.omp.json | Invoke-Expression

# for Zsh, add this to ~/.zshrc
eval "$(oh-my-posh init zsh --config ~/PATH_TO_DIR/posh2k/posh2k.omp.json)"

# for Bash, add this to
Enter fullscreen mode Exit fullscreen mode

Hit the ️❤️ button if you found this useful.

Follow me on Twitter | Linkedin | Instagram to stay in touch.

Top comments (17)

Collapse
 
wjplatformer profile image
Wj

Honestly, after using this for quite a while, this is REALLY AWESOME. Because sometimes when the branch is master or main, I can just glance up to the terminal to see which branch I have to commit to, making this extremely useful. Thanks!

Collapse
 
2kabhishek profile image
Abhishek Keshri

yup, you also get indicators for language versions, env settings and even much more if you customize custom sections, sky is the limit!

Collapse
 
wjplatformer profile image
Wj

Image description

I assume you don't run this. But where do you add this thing? 😁😊😅😶‍🌫️

Collapse
 
wjplatformer profile image
Wj

I am using cmd, installed clink, installed oh-my-posh, but have no idea where to add this line of code

Collapse
 
2kabhishek profile image
Abhishek Keshri

You are right, I don't use cmd/clink but it should have options to write configs in lua

Thread Thread
 
wjplatformer profile image
Wj

AH I THINK I GOT IT

Thread Thread
 
wjplatformer profile image
Wj

oh no actually windows 11 can't really change anuthing to settings 😱 lmao I think I'm going to die wait a sec need to do more digging

Thread Thread
 
wjplatformer profile image
Wj
the code below is incomprehensible to my knowledge

Image description
erm... ok one question for you, where did you actually get the line of code for clink and cmd? To add it? (in which case, I am saying, if you have any documentation maybee it's better to link it on the readme hehehehudhfedhe ok sorry I'll do more digging)

Thread Thread
 
wjplatformer profile image
Wj

ohmyposh.dev/docs/installation/prompt ah I see, I guess I am dumb as heck to not read the official docimentation after all

Thread Thread
 
2kabhishek profile image
Abhishek Keshri

No worries, glad you figured it out

Thread Thread
 
2kabhishek profile image
Abhishek Keshri

Also I'd suggest not to use CMD unless you really have to, Powershell is much better comparatively

Thread Thread
 
wjplatformer profile image
Wj

agreed. But my main terminal at the time was cmd, but switching over wasn't that bad lol.

Collapse
 
wjplatformer profile image
Wj

Hey, may I know how do you connect your spotify?

Collapse
 
2kabhishek profile image
Abhishek Keshri

Sadly I have only been able to make it work on windows.
Just by using the Spotify app.

Collapse
 
wjplatformer profile image
Wj

so you have a windows computer and a macos pc? I think that explains it. Thanks!

Collapse
 
wjplatformer profile image
Wj

OOOOhhh fancy 🥂

Collapse
 
2kabhishek profile image
Abhishek Keshri

Thanks man! I hope you tried it