Fixed prompt
This commit is contained in:
parent
48a4cc774f
commit
33e04073d0
@ -22,8 +22,6 @@ precmd_pyenv_info() {
|
||||
fi
|
||||
}
|
||||
|
||||
_kernel_pkg=$(pacman -Qqo /usr/lib/modules/$(uname -r)/vmlinuz 2>/dev/null)
|
||||
|
||||
precmd_kernel_info() {
|
||||
# check to see if a kernel update has been installed
|
||||
# since we need to reboot to use it
|
||||
@ -33,26 +31,13 @@ precmd_kernel_info() {
|
||||
if [[ -n ${kernel_info_msg_0_} ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ -z ${_kernel_pkg} ]]; then
|
||||
# no kernel package found, so we can't check for updates
|
||||
return
|
||||
fi
|
||||
case ${_kernel_pkg} in
|
||||
"linux")
|
||||
# mainline kernel
|
||||
diff <(uname -r | sed 's/-/./;s/\.0\././') <(pacman -Q linux | cut -d' ' -f2) >/dev/null
|
||||
_ret=$?
|
||||
;;
|
||||
"linux-lts")
|
||||
# lts kernel
|
||||
diff <(uname -r | sed 's/-lts//') <(pacman -Q linux-lts | cut -d' ' -f2) >/dev/null
|
||||
_ret=$?
|
||||
;;
|
||||
esac
|
||||
diff <(uname -r | sed 's/-/./;s/\.0\././') <(pacman -Q linux | cut -d' ' -f2) >/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
# kernel update available
|
||||
kernel_info_msg_0_="%F{red} reboot required %f"
|
||||
if [[ ${OS_ID} == "arch" ]] || [[ ${OS_ID_LIKE} == "arch" ]]; then
|
||||
# Arch Linux removes the old kernel when updating, so we can
|
||||
# just check to see if /usr/lib/modules/$(uname -r)/vmlinuz exists
|
||||
if [[ -f /usr/lib/modules/$(uname -r)/vmlinuz ]]; then
|
||||
# kernel update available
|
||||
kernel_info_msg_0_="%F{red} reboot required %f"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user