]> git.rmz.io Git - dotfiles.git/blob - zsh/lib/motd.zsh
nvim: disable snacks scroll animation
[dotfiles.git] / zsh / lib / motd.zsh
1 autoload colors; colors;
2
3 short()
4 {
5 print "$fg_bold[white]$1$reset_color $2"
6 }
7
8 msg()
9 {
10 print "$fg_bold[white]$1$reset_color\n$2\n"
11 }
12
13 if (( $+commands[checkupdates] )); then
14 # checkupdate.service populates this db
15 pkg_count=$(CHECKUPDATES_DB=/tmp/checkup-db-0 checkupdates -n | grep -cv '\[.*\]')
16 fi
17
18 if (( $+commands[task] )); then
19 # this is moved after checkupdates above because it introduces enough of a delay
20 # for the terminal width calculation to have the right width stored
21 # see https://github.com/wez/wezterm/issues/5137
22 task rc.verbose:0 motd limit:5
23 fi
24
25 if (( ${pkg_count:-0} > 0 )); then
26 short "Outdated packages: $pkg_count"
27 fi
28
29 if (( $+commands[pacman] )); then
30 kercmp -q || short "linux" "$(kercmp)"
31 fi
32
33 if (( $+commands[systemctl] )); then
34 systemctl --system --no-pager list-units -q --failed
35 systemctl --user --no-pager list-units -q --failed
36 fi
37
38 # list sessions if possible
39 tmux list-sessions 2>/dev/null || true