mirror of
https://github.com/vhaudiquet/mymachine.git
synced 2025-12-18 20:16:05 +00:00
Update prompt settings
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source /etc/os-release
|
||||||
|
|
||||||
parse_git_branch()
|
parse_git_branch()
|
||||||
{
|
{
|
||||||
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ <\1>/')
|
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ <\1>/')
|
||||||
@@ -22,7 +24,11 @@ parse_docker_context()
|
|||||||
|
|
||||||
parse_kubernetes_context()
|
parse_kubernetes_context()
|
||||||
{
|
{
|
||||||
ctx=$(kubectx -c)
|
ctx=$(kubectx -c 2>/dev/null)
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$ctx" = "default" ]; then
|
if [ "$ctx" = "default" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
@@ -40,6 +46,12 @@ kernel_installed_version() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PROMPT_NEED_REBOOT() {
|
PROMPT_NEED_REBOOT() {
|
||||||
|
# Ignore that part of the prompt on non-arch distribution
|
||||||
|
if ! [ "${ID}" = "arch" ]; then
|
||||||
|
echo ""
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
live=$(kernel_live_version)
|
live=$(kernel_live_version)
|
||||||
installed=$(kernel_installed_version)
|
installed=$(kernel_installed_version)
|
||||||
if [ "$live" = "$installed" ]; then
|
if [ "$live" = "$installed" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user