• We did not send an email asking for donations - please read this post.

Custom Bash prompts (or other shells!)

LorenDB

Well-Known Member
Joined
May 12, 2020
Messages
393
Reaction score
316
Credits
2,725
Yesterday I dove into Bash prompt customization. Having emerged from the other side, I'm interested in seeing if anybody else has custom prompts in their shell.

To start things off, here's mine:
1662154813560.png

An overview of the components of this:
0. A battery indicator that shows if the battery needs charged or is charging. It will not show if there is no battery installed.
1. The standard [email protected] bit.
2. The "status indicator." By default, it shows the openSUSE logo. However, it currently supports detecting source code for C++ (shown above), C, and D.
3. The standard directory view. Someday I plan to add eliding to this, so ~/a/very/long/path/that/unfortunately/measures/over/fifty/characters/long becomes ~/a/very/long/pat...res/over/fifty/characters/long.
4. A git indicator shown if you are in the root of a git repository. By default, it will try to show the hosting provider (GitHub, GitLab, and BitBucket are currently supported); if it cannot do that, it will show the git logo. Also, if it happens to not be on the default branch (currently, the default branch is assumed to be either master or main), it will display a branch icon (not shown here).
5. The prompt. I've gone for the lambda prompt here as I think it looks really cool; I also took advantage of the little block thingys you see here.

These icons and blocks would not be possible without Nerd fonts.

This is definitely an improvement over the generic prompt that originally was generated by Ubuntu (I've migrated my .bashrc from Ubuntu to Tumbleweed):
1662155405767.png


So what does your prompt look like?
 


craigevil

Well-Known Member
Joined
Feb 24, 2021
Messages
397
Reaction score
391
Credits
2,745
I am using Powerline defaults. You might want to take a look at starship.
2022-09-02_18-32.png
 
OP
LorenDB

LorenDB

Well-Known Member
Joined
May 12, 2020
Messages
393
Reaction score
316
Credits
2,725
I've seen starship, but it didn't quite suit my fancy (and anyway, it's more fun to roll your own!).
 

Cozy Makayla

New Member
Joined
Nov 1, 2022
Messages
5
Reaction score
7
Credits
44
A little late to the party but here's mine

ArcoLinux-2022-11-01-1667335622_screenshot_1920x1080.jpg


I took a lot of inspiration from Learn Linux TVs new video but its all my own work :)

ArcoLinux-2022-11-01-1667335867_screenshot_1920x1080.jpg

here's the code if anyone wants it;

PS1='\n┌─┤\[\e[1;31m \d\e[0m├───┤\[\e[1;32m \@\e[0m├───┤\[\e[1;34m \u\e[0m├───┤\[\e[1;33m \h\e[0m├───┤\[\e[1;37m \w \e[0m│\n└──[\s] ~ '

the icons get messed up when posting so you'll have to source them, let me know if there's any questions
 

JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,570
Reaction score
2,232
Credits
11,611
Meh! I just stick with the default prompt. I don’t need anything too elaborate or fancy looking!
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top