From a7173a138ac86f8f068fcb9d73f5454dc1d31468 Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Wed, 20 Aug 2025 17:50:05 +0200 Subject: [PATCH] Update prompt settings --- dotfiles/.config/prompt.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dotfiles/.config/prompt.sh b/dotfiles/.config/prompt.sh index 0016414..35230e8 100644 --- a/dotfiles/.config/prompt.sh +++ b/dotfiles/.config/prompt.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +source /etc/os-release + parse_git_branch() { branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ <\1>/') @@ -22,7 +24,11 @@ parse_docker_context() parse_kubernetes_context() { - ctx=$(kubectx -c) + ctx=$(kubectx -c 2>/dev/null) + if [ $? -ne 0 ]; then + echo "" + fi + if [ "$ctx" = "default" ]; then echo "" else @@ -40,6 +46,12 @@ kernel_installed_version() { } PROMPT_NEED_REBOOT() { + # Ignore that part of the prompt on non-arch distribution + if ! [ "${ID}" = "arch" ]; then + echo "" + return + fi + live=$(kernel_live_version) installed=$(kernel_installed_version) if [ "$live" = "$installed" ]; then