My most recent adventure: Customizing my terminal prompt using Starship!

I read an item in today’s (March 6, 2025) ZDNet newsletter titled “Why the Starship prompt is better than your default on Linux and MacOS”. I was intrigued, so I followed the author’s instructions, and installed starship on my Garuda GNU/Linux system.

Interestingly, my prompt did not change following installation and activation of starship, so I asked if Garuda uses starship to customize the terminal prompt in Firefox (I think Firefox uses the Google search engine), and the AI responded yes, explaining the advantages of starship (blatant advertising), so I suspect that starship was already installed on my system.

I proceeded to customize my prompt to suit my preferences, using the starship configuration documentation. It now looks like this:
Colorized prompt

Note 1:
I couldn’t figure out how to capture a colorized screenshot of my terminal window, so I built this image using KDE’s character map app (KCharSelect) and kolourpaint.

Note 2:
It took me some time and a lot of experimentation to figure out where/how to use the commands I was learning about.

Note 3:
The bottom line (below the clock icon and time) is green with a double right arrow character when the command was successful, and red with an x character when it failed.

Note 4:
While reading the starship configuration documentation, I noticed that PowerShell is supported, so I switched to my Windows 11 system and followed the installation steps itemized on the main page of the starship website to install and activate it.

Next, I tracked down the two commands I needed to execute in PowerShell to create the starship.toml file in the .config folder in Windows, namely:

New-Item -ItemType Directory -Force ~/.config
New-Item -ItemType file ~/.config/starship.toml

Next, I switched back to my Garuda system and copied my starship.toml configuration file to my data partition (formatted as NTFS for Windows) so I could get to it there. You could also copy it to a USB flash drive if you PowerShell in Windows.

I then returned to Windows and copied the content of starship.toml in my data partition to the empty starship.toml file in the recently created .config folder at C:\Users\e-wil\.config on my system (replace e-wil with your user name on your system). Now my PowerShell prompt in Windows 11 looks exactly like the prompt in my Konsole terminal on Garuda KDE-Lite!

I hope you like my prompt. Maybe you can try out starship and customize your own prompt, and show it here too,

Ernie

7 Likes

Is that the enterprise version spock ?

3 Likes

I customized and it affected air traffic control in my area.
The neighbors weren’t very happy.

4 Likes

That is easy
Use the screenshot app.
Choose Select Area
Outline the area with mouse and 1st button
Save the shot as an image… it will go in -/Pictures

Then you can upload that image file to itsfoss.

2 Likes

I was able to take a screenshot, but it came out in shades of grey (no colors). I wasn’t satisfied with that, so I built the image you see in my original post. Did you mean that there’s a screenshot app I can install? if so, I’ll look for it in Garuda’s repositories, and install it if it isn’t already. Having such an app would have saved me some bother yesterday :slight_smile:

UPDATE
I did some research and found Spectacle, a screenshot utility for KDE. It works great. I opened my Konsole terminal app, started spectacle, and a new window popped up with a full-screen image. I chose Active Window on the selection bar (right), and the image switched to my terminal window. I saved it to my ~/Pictures/Screenshots directory, and this is what I got:


Now everyone can see my new prompt exactly as it is!

Ernie

3 Likes

Hi Ernie
My Garuda Xfce as a VM includes the basic screenshot tool.
Your DE may be different.

2 Likes

Congrats

I knew starship indirectly due my learning process about zsh and oh my zsh

For many tutorials about the two latest mentioned is covered with powerlevel10k which it is the continuation of powerlevel9k and now starship replacement powerlevel10k.

The environment is pretty nice

2 Likes

Yes, there is a screenshot app,
In MX with Xfce it is called screenshot
In other DE’s it may have another name.
Search your repo for screenshot… it should find at least one app.

Your grey may be because you used a non-color image type. I use .png for screenshots… it supports color

1 Like

True, In KDE it’s named Spectacle. I’ve installed the app, and now I get excellent screenshots! You can see my full Konsole terminal window in my previous post (post number 5).

Ernie

3 Likes

Hey Ernie,
I was actually thinking about posting my own journey with Starship, but you beat me to it!

Here is what my prompt looks like:

It has support for icons for some file paths, for example, here is what downloads looks like:

Finally, this is what is looks like if somehow most of these fields were being used at once. Also note that it truncates the path if it is too long:

This is using a modified version of the Pastel Powerline preset for Starship. Primarily, I changed the colors, removed some modules I didn’t need, added some new ones I wanted and rearranged them a bit. It was a lot of fun and I really like how it looks

4 Likes

Wow! Your prompt looks really cool! At 75, it’s not my cup-o-tea, but I can still appreciate it’s beauty.

Ernie

2 Likes

I’m using alacritty as terminal emulator and added the lines you see in the picture to my bashrc

4 Likes

It is. Garuda-KDE-Lite comes with the usual Garuda system support software, but absolutely no KDE customization’s. I wanted that so I could make my DE look the way i want it to. I just didn’t realize that a few of the lower level KDE utilities weren’t installed out-of-the box, although I should have.

Ernie

2 Likes

I have heard a few times about things that are different in Garuda. It is its own distro. You simply have to watch out for things that may differ from Debian.
Void is like that too.

1 Like

Garuda offers several DE ‘flavors’. I chose the KDE-Lite flavor because of the minimal customization it comes with. I wanted to make it my own, and not having to undo or re-do much of what the Garuda Dev-team thinks users want makes that process much easier for the most part. It just didn’t occur to me that the Spectacle Print-Screen utility wouldn’t be installed out-of-the-box, so I ‘built’ a ‘picture’ of my new prompt when I saw the grey-scale PrtScr output. I suppose that I was as proud of the image I created to depict my new prompt as I was about my prompt customization itself. :slight_smile: You know what they say about pride. Right? It goes before the fall …

Ernie

2 Likes

Its fine.
Think about changing prompt color to red if you become root.
Where I worked, they once has 2 servers called Pride and Prejudice. Pride was the best machine. They ran Solaris.

1 Like

Thank you for the suggestion. After much Internet searching, my prompt, when I sudo to root is a Bold Red [ROOT], like this:

All I had to do was edit the .bashrc file in /root
It works for me :slight_smile:
Ernie

3 Likes

On ALL my own machines - I use ZSH for “me”, but default to bash for root…

So I know when I’m root… Even on MacOS - i.e. the default shell for MacOS desktop users is ZSH these days (and Oh-My-Zsh installs just fine on MacOs like it does on Linux) - if I 'sudo -i" (become root) - I get /bin/sh as my shell and no fancy schmancy prompt…

I kinda HATE red writing in a terminal window (I have background set to black) - being Red / Green colour blind, I find it really difficult to read…

and - my preferred Oh-My-ZSH them is called “gnzh” - but - the default hostname prompt, if I’m a remote user, is in red - so I change that in my .oh-my-zsh/custom/themes and use
.oh-my-zsh/custom/themes/dmt-gnzh.zsh-theme as my zsh them, and use sed to replace “red” with the value 141 which is some kinda “dark blue”.

My Ubuntu 24.04 on Dell Latitude still has the default colour for my ZSH theme - and I hate it but I barely ever remote to it :
Here’s the default :


I have HUGE trouble reading that red text.

And here’s what I usually change it to (#141) :
Screenshot 2025-03-30 at 11.50.29 am

But that “bluish” value for #141 - is still different to when accessing locally (e.g. in Gnome Terminal) :
My default session in Gnome terminal - sorta “Greenish” I think - then I “ssh 0” (0 is a sorta alias or shorthand for 127.0.0.1 - that’s an ancient UNIX legacy that still works in Linux) - I get the blue prompt (#141) :


That “<master>” bit on the green prompt - is 'cause oh-my-zsh is “GIT Aware” - so if there’s some git dot files in the $PWD - it shows that… I barely use GIT, but, I do like that feature…

Here’s what my main oh-my-zsh custom theme looks like :

# Based on bira theme

setopt prompt_subst

() {

local PR_USER PR_USER_OP PR_PROMPT PR_HOST

# Check the UID
if [[ $UID -ne 0 ]]; then # normal user
  PR_USER='%F{green}%n%f'
  PR_USER_OP='%F{green}%#%f'
  PR_PROMPT='%f➤ %f'
else # root
  PR_USER='%F{141}%n%f'
  PR_USER_OP='%F{141}%#%f'
  PR_PROMPT='%F{141}➤ %f'
fi

# Check if we are on SSH or not
if [[ -n "$SSH_CLIENT"  ||  -n "$SSH2_CLIENT" ]]; then
  PR_HOST='%F{141}%M%f' # SSH
else
  PR_HOST='%F{green}%M%f' # no SSH
fi


local return_code="%(?..%F{141}%? ↵%f)"

local user_host="${PR_USER}%F{cyan}@${PR_HOST}"
local current_dir="%B%F{blue}%~%f%b"
local git_branch='$(git_prompt_info)'

PROMPT="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch}
╰─$PR_PROMPT "
RPROMPT="${return_code}"

ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %f"
ZSH_THEME_RUBY_PROMPT_PREFIX="%F{141}‹"
ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f"

}

Note : that stuff for “root” is irrelevant for me - because for a start, I don’t use ZSH as my shell for any of my systems for the root user…
What I like about ZSH themes - is - they look and read a lot like a bash shell script…

4 Likes

I like what you’ve done, and I understand the complexity, particularly if you’re RED/GREEN-color blind. Since I’m fortunate enough that I don’t suffer from any form of color-blindness, and I only use my desktop and two laptop PCs, combined with the fact that I learned Bash way back in the late 1990s, when I initially started using GNU/Linux, I stick with it everywhere, and I make part of my root prompt Red so I never forget that I’m root when working as an administrator. While I normally use sudo to perform most of my administrative tasks, there are times when I su to root to do more complex things. Thankfully, those times are infrequent, but even so, I never want to forget that I’m in root while working since I am getting older :slight_smile:

Ernie

2 Likes

My habit, from the old days of B&W terminals, is to always make a root window small ( say 60 x 20) and put it on the bottom left. That helps to avoid using it accidentally.

3 Likes