Wie ich die bash 2025 angepasst habe

Es ist 2025, Pop_OS 24.04 ist noch nicht released und ich bin von der zsh zurück zu bash gewechselt.

Warum ist relativ einfach, die Features der zsh sind nicht mehr exklusiv und jetzt(wenn auch mit zusätzlicher Software) für die bash verfügbar.

Für mich ist ein modernes Design wichtig und für die bash bzw. die gängigsten Shells gibt es ein Tool namens starship dafür wird ein NerdFont vorausgesetzt, weil dort einfach deutlich mehr Symbole enthalten sind.

Ich persönlich benutze aktuell den GohuFont Nerd Font, der besitzt eine charmante Retropixel-Optik.

Die Installation einer neuen Font ist in den gängigsten Linux-Distributionen über den Fontmanager möglich, da die je nach Desktop Environment etwas anders heißen, kann ich hier keine genauere Anleitung geben.

Hat man jetzt einen ansprechenden Nerd Font intalliert, muss man diesen nur noch im bevorzugen Terminal einstellen.

Starship ist dann sehr einfach installiert:

mit

curl -sS https://starship.rs/install.sh | sh

wird starship installiert und mit dem hinzufügen von

eval "$(starship init bash)"

in der .bashrc aktiviert, dann nur noch Terminal zu und wieder auf oder ein "source .bashrc"

Jetzt muss man nur noch die Optik an seine Bedürfnisse anpassen:

Es gibt schon eine gute Auswahl an presets

Ich habe mich aktuell für das an die Nord Palette angepasste Gruvbox Rainbow Preset entschieden.

starship preset gruvbox-rainbow -o ~/.config/starship.toml

damit installiert man das nicht angepasste Preset.

Wer die Nord Farbpalette gefällt kann gerne meine starship.toml dafür benutzen:

"$schema" = 'https://starship.rs/config-schema.json'

format = """
[](color_orange)\
$os\
$username\
[](bg:color_yellow fg:color_orange)\
$directory\
[](fg:color_yellow bg:color_aqua)\
$git_branch\
$git_status\
[](fg:color_aqua bg:color_blue)\
$c\
$rust\
$golang\
$nodejs\
$php\
$java\
$kotlin\
$haskell\
$python\
[](fg:color_blue bg:color_bg3)\
$docker_context\
$conda\
[](fg:color_bg3 bg:color_bg1)\
$time\
[ ](fg:color_bg1)\
$line_break$character"""

palette = 'nord_dark'

[palettes.nord_dark]
color_fg0 = '#eceff4'
color_bg1 = '#434c5e'
color_bg3 = '#4c566a'
color_blue = '#5e81ac'
color_aqua = '#8fbcbb'
color_green = '#a3be8c'
color_orange = '#d08770'
color_purple = '#b48ead'
color_red = '#bf616a'
color_yellow = '#ebcb8b'

[os]
disabled = false
style = "bg:color_orange fg:color_fg0"

[os.symbols]
Windows = "󰍲"
Ubuntu = "󰕈"
SUSE = ""
Raspbian = "󰐿"
Mint = "󰣭"
Macos = "󰀵"
Manjaro = ""
Linux = "󰌽"
Gentoo = "󰣨"
Fedora = "󰣛"
Alpine = ""
Amazon = ""
Android = ""
Arch = "󰣇"
Artix = "󰣇"
EndeavourOS = ""
CentOS = ""
Debian = "󰣚"
Redhat = "󱄛"
RedHatEnterprise = "󱄛"
Pop = ""

[username]
show_always = true
style_user = "bg:color_orange fg:color_fg0"
style_root = "bg:color_orange fg:color_fg0"
format = '[ $user ]($style)'

[directory]
style = "fg:color_fg0 bg:color_yellow"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"

[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = "󰝚 "
"Pictures" = " "
"Developer" = "󰲋 "

[git_branch]
symbol = ""
style = "bg:color_aqua"
format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)'

[git_status]
style = "bg:color_aqua"
format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)'

[nodejs]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[c]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[rust]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[golang]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[php]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[java]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[kotlin]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[haskell]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[python]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[docker_context]
symbol = ""
style = "bg:color_bg3"
format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)'

[conda]
style = "bg:color_bg3"
format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)'

[time]
disabled = false
time_format = "%R"
style = "bg:color_bg1"
format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)'

[line_break]
disabled = false

[character]
disabled = false
success_symbol = '[](bold fg:color_green)'
error_symbol = '[](bold fg:color_red)'
vimcmd_symbol = '[](bold fg:color_green)'
vimcmd_replace_one_symbol = '[](bold fg:color_purple)'
vimcmd_replace_symbol = '[](bold fg:color_purple)'
vimcmd_visual_symbol = '[](bold fg:color_yellow)'

Wer jetzt noch die beiden Features autosuggestions und syntax-highlighting benötigt, dem kann ich den Bash Line Editor empfehlen.
Die Installation ist zwar sehr individuell aber damit vermisst man nichts mehr aus der zsh. (also ich zumindest)

Wer mir verraten kann wie ich im Bash Line Editor die Farben anpassen kann, möchte ich bitten das in den Kommentaren mit der Welt zu teilen.

Ach und für das bisschen Terminal Bling Bling nutze ich ufetch.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert