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:
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
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
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
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):
So what does your prompt look like?
To start things off, here's mine:
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
user@host
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):
So what does your prompt look like?