From 6b5174d7f3314302a626d49e3e2159f82239fa95 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Tue, 22 Dec 2020 11:05:13 -0800 Subject: [PATCH] Add starship configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • init starship as part of bash • add starship wip config • ignore standard bash prompt is starship is inited --- bash/.config/bash/prompt.sh | 4 ++ starship/.config/bash/bashrc.d/starship.sh | 1 + starship/.config/starship.toml | 51 ++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 starship/.config/bash/bashrc.d/starship.sh create mode 100644 starship/.config/starship.toml diff --git a/bash/.config/bash/prompt.sh b/bash/.config/bash/prompt.sh index 565795f..16e1b45 100644 --- a/bash/.config/bash/prompt.sh +++ b/bash/.config/bash/prompt.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +if [[ -z ${STARSHIP_SESSION_KEY} ]] ; then + return +fi + # Reset color_off='\e[0m' # Text Reset diff --git a/starship/.config/bash/bashrc.d/starship.sh b/starship/.config/bash/bashrc.d/starship.sh new file mode 100644 index 0000000..b6ee6e8 --- /dev/null +++ b/starship/.config/bash/bashrc.d/starship.sh @@ -0,0 +1 @@ +eval "$(starship init bash)" diff --git a/starship/.config/starship.toml b/starship/.config/starship.toml new file mode 100644 index 0000000..2e01abf --- /dev/null +++ b/starship/.config/starship.toml @@ -0,0 +1,51 @@ +format = """\ + $username\ + $hostname\ + $directory\ + $git_branch\ + $git_commit\ + $git_state\ + $git_status\ + $time\ + $cmd_duration\ + $line_break\ + $character\ +""" + +[username] +disabled = false +show_always = true +style = "green" +style_user = "green" + +[hostname] +disable = false +ssh_only = false +style = "purple" +# format = "[$hostname]($style)" + +[git_branch] +style = "black bold" +symbol = "" +# format = "[$symbol$branch]($style)" + +[directory] +truncation_length = 0 +use_logical_path = true +truncate_to_repo = false +style = "blue" + +[time] +disabled = false +style = "purple" +time_format = "%T" +format = "[$time]($style)" + +[cmd_duration] +# $duration – The command duration (e.g. "15s") +# $style – The default style of the module (e.g. "bold yellow") +format = "took [$duration]($style) " + +[character] +success_symbol = "λ" +style_success = ""