This commit is contained in:
Marc Beninca 2024-11-16 02:55:41 +01:00
parent 6eaab0b75f
commit f366620418
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -49,14 +49,13 @@ esac
# prompt # prompt
ps1() { ps1() {
local date host id type local date host id
local code="${1}" local code="${1}"
date="$(date +%H:%M:%S)" date="$(date +%H:%M:%S)"
local git local git
host="$(hostname)" host="$(hostname)"
id="$(id --user)" id="$(id --user)"
local path="${PWD}" local path="${PWD}"
type="$(type -t __git_ps1)"
local user="${USER}" local user="${USER}"
local view="└ " local view="└ "
# code # code
@ -70,7 +69,7 @@ ps1() {
view="${view}${SH_DEFAULT} @ " view="${view}${SH_DEFAULT} @ "
view="${view}${SH_BROWN}${date}" view="${view}${SH_BROWN}${date}"
# git # git
if [ "${type}" = "function" ]; then if command -v "__git_ps1" >"/dev/null"; then
git="$(__git_ps1)" git="$(__git_ps1)"
if [ -n "${git}" ]; then if [ -n "${git}" ]; then
view="${view}${SH_DEFAULT}${SH_MAGENTA}${git}" view="${view}${SH_DEFAULT}${SH_MAGENTA}${git}"