diff --git a/zsh/.zsh/functions.zsh b/zsh/.zsh/functions.zsh index 9383946..b34b10b 100644 --- a/zsh/.zsh/functions.zsh +++ b/zsh/.zsh/functions.zsh @@ -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 diff --git a/zsh/.zsh/prompt.zsh b/zsh/.zsh/prompt.zsh index 8731a5a..dbb3246 100644 --- a/zsh/.zsh/prompt.zsh +++ b/zsh/.zsh/prompt.zsh @@ -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 '