updating zsh prompt to show when a reboot is required and a function 'reboot_for' to show what is driving the reboot need
This commit is contained in:
parent
e679f41745
commit
06861bdd16
2 changed files with 14 additions and 4 deletions
|
@ -23,8 +23,14 @@ function truncated_pwd() {
|
|||
echo ${(j:/:)dirs}
|
||||
}
|
||||
|
||||
function collapse_pwd {
|
||||
echo $(pwd | sed -e "s,^$HOME,~,")
|
||||
# Show what requires a reboot if one is required
|
||||
reboot_for() {
|
||||
if test -f /var/run/reboot-required; then
|
||||
echo "Reboot required for:"
|
||||
cat /var/run/reboot-required.pkgs
|
||||
else
|
||||
echo "Nothing requires a reboot."
|
||||
fi
|
||||
}
|
||||
|
||||
# Extract anything
|
||||
|
|
|
@ -30,7 +30,11 @@ function git_unstaged {
|
|||
}
|
||||
|
||||
function current_pwd {
|
||||
echo $(pwd | sed -e "s,^$HOME,~,")
|
||||
echo $(pwd | sed -e "s,^$HOME,~,")
|
||||
}
|
||||
|
||||
PROMPT='%m ${PR_BOLD_YELLOW}$(truncated_pwd 3)$(git_branch)%{$reset_color%}$(git_unstaged)$(git_is_ahead)$(git_is_behind) %(?.%F{magenta}.%F{red})❯%f '
|
||||
function check_reboot {
|
||||
test -f /var/run/reboot-required && echo "R "
|
||||
}
|
||||
|
||||
PROMPT='${PR_BOLD_RED}$(check_reboot)${reset_color}%m ${PR_BOLD_YELLOW}$(truncated_pwd 3)$(git_branch)%{$reset_color%}$(git_unstaged)$(git_is_ahead)$(git_is_behind) %(?.%F{magenta}.%F{red})❯%f '
|
||||
|
|
Loading…
Reference in a new issue