From e6863be5d96bc2f3e6f64b91a55061ca25613d06 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 26 Mar 2024 00:46:32 +0000 Subject: [PATCH] zsh: print 5 most urgent tasks as motd --- zsh/lib/motd.zsh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zsh/lib/motd.zsh b/zsh/lib/motd.zsh index be5b477..a929b35 100644 --- a/zsh/lib/motd.zsh +++ b/zsh/lib/motd.zsh @@ -10,17 +10,22 @@ msg() print "$fg_bold[white]$1$reset_color\n$2\n" } -if [[ -d ~/org ]]; then - org-agenda -fi - if (( $+commands[checkupdates] )); then # checkupdate.service populates this db pkg_count=$(CHECKUPDATES_DB=/tmp/checkup-db-0 checkupdates -n | grep -cv '\[.*\]') - if (( $pkg_count > 0 )); then - short "Outdated packages: $pkg_count" - fi fi + +if (( $+commands[task] )); then + # this is moved after checkupdates above because it introduces enough of a delay + # for the terminal width calculation to have the right width stored + # see https://github.com/wez/wezterm/issues/5137 + task rc.verbose:0 motd limit:5 +fi + +if (( ${pkg_count:-0} > 0 )); then + short "Outdated packages: $pkg_count" +fi + if (( $+commands[pacman] )); then kercmp -q || short "linux" "$(kercmp)" fi -- 2.48.1