Skip to content

Instantly share code, notes, and snippets.

@Mohammad-Reihani
Last active August 27, 2025 20:37
Show Gist options
  • Save Mohammad-Reihani/d7bbf7ece3600fd25207d1d84437aacd to your computer and use it in GitHub Desktop.
Save Mohammad-Reihani/d7bbf7ece3600fd25207d1d84437aacd to your computer and use it in GitHub Desktop.
Starship configuration file | Reproduced Kali's default PS1 prompt
# ~/.config/starship.toml
add_newline = true
continuation_prompt = "[▸▹ ](dimmed white)"
format = """[┌──\\(](bold green)$username[㉿](bold green)$hostname[\\)-\\[](bold green)$time[\\]-\\[](bold green)$directory[\\]](bold green)\
(\n[│](green)( $python) |( $git_branch$git_commit$git_state))
[└](bold green)$cmd_duration[─](bold green)[\\$ ](bold blue)"""
right_format = '''$battery'''
[python]
format = '[\[$symbol$version\][(\[$virtualenv\])](dimmed red)]($style)'
symbol = '👾 '
version_format = 'v${raw}'
pyenv_version_name = false
[git_branch]
format = '[\[$symbol$branch\]]($style)'
[git_commit]
format = '[\[commit hash:$hash$tag\]]($style)'
commit_hash_length = 8
only_detached = false
tag_disabled = false
style = "dimmed yellow"
[git_state]
format = '[\[$state( $progress_current of $progress_total)\]]($style)'
style = "dimmed yellow"
[hostname]
ssh_only = false
format = "[$hostname]($style)"
trim_at = "-"
style = "bold dimmed blue"
disabled = false
[username]
show_always = true
style_root = "bg:#9A348E"
format = '[$user]($style)'
disabled = false
style_user = "bold dimmed blue"
[time]
disabled = false
format = "[🕙$time]($style)"
time_format = "%R"
utc_time_offset = "local"
style = "italic dimmed white"
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"
[[battery.display]]
threshold = 100
style = "bold red"
[character]
error_symbol = "[✖](bold red) "
[cmd_duration]
min_time = 10_000 # Show command duration over 10,000 milliseconds (=10 sec)
style = "dimmed red"
format = '[\(took $duration\)]($style)'
[directory]
truncation_length = 5
format = "[$path]($style)[$lock_symbol]($lock_style)"
[git_status]
conflicted = "⚔️ "
ahead = "🏎️ 💨 ×${count} "
behind = "🐢 ×${count} "
diverged = "🔱 🏎️ 💨 ×${ahead_count} 🐢 ×${behind_count} "
untracked = "🛤️ ×${count} "
stashed = "📦 "
modified = "📝 ×${count} "
staged = "🗃️ ×${count} "
renamed = "📛 ×${count} "
deleted = "🗑️ ×${count} "
style = "bright-white"
format = "$all_status$ahead_behind"
[julia]
format = "[$symbol$version]($style) "
symbol = "ஃ "
style = "bold green"
[memory_usage]
format = "$symbol[${ram}( | ${swap})]($style) "
threshold = 70
style = "bold dimmed white"
disabled = false
[package]
disabled = true
[rust]
format = "[$symbol$version]($style) "
style = "bold green"
[typst]
format = "[$symbol($version)]($style)"
style = "bold #239dae"
[sudo]
format = "[$symbol]($style)"
style = "bold italic bright-purple"
symbol = "⋈┈"
disabled = false
[nodejs]
format = "via [🤖 $version](bold green) "
@Mohammad-Reihani
Copy link
Author

Mohammad-Reihani commented Aug 2, 2024

Starship Configuration for Kali Linux Prompt

This Starship configuration file reproduces the default Kali Linux PS1 prompt with added features like git status, battery indicator, and time. Enhance your terminal experience with this rich and creative setup!


To use with Bash, add the following to your .bashrc:

# Starship
eval "$(starship init bash)"

# Function to set the prompt
function starship_prompt() {
    # Get the status code from the last command executed
    STATUS=$?

    # Get the number of jobs running
    NUM_JOBS=$(jobs -p | wc -l)

    # Set the prompt
    PS1="$(starship prompt --status=$STATUS --jobs=$NUM_JOBS)"
}

# Call the function to set the prompt
PROMPT_COMMAND=starship_prompt

How to use on windows?

just type starship config, it will open a starship.toml file in C:\Users$USERNAME.config\
put this config in there
also see how to use starship with powershell


Using on Alpine?

after installing bash for example instead of the default shell, you should ensure that .bashrc is sourced correctly, you can modify your .bash_profile or .profile to source .bashrc. Here’s how you can do that:

  1. Create or Edit .bash_profile or .profile:

    Open the .bash_profile (or .profile) file in your home directory:

    nano ~/.bash_profile

    If .bash_profile does not exist, you can create it. Add the following lines to ensure .bashrc is sourced:

    # Check for a bashrc file and source it if it exists
    if [ -f ~/.bashrc ]; then
        . ~/.bashrc
    fi

    exit and login again


NOTE:: This is not the final version and is going to be updated.


@MohsenNS
Copy link

MohsenNS commented Aug 3, 2024

Thank you so much!
I needed kali

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment