]>
git.rmz.io Git - dotfiles.git/blob - zsh/lib/motd.zsh
a929b352d4f776656a7fc928cdef2b0960273688
1 autoload colors
; colors
;
5 print
"$fg_bold[white]$1$reset_color $2"
10 print
"$fg_bold[white]$1$reset_color\n$2\n"
13 if (( $
+commands
[checkupdates
] )); then
14 # checkupdate.service populates this db
15 pkg_count
=$(CHECKUPDATES_DB=/tmp/checkup-db-0 checkupdates -n | grep -cv '\[.*\]')
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
25 if (( ${pkg_count:-0} > 0 )); then
26 short
"Outdated packages: $pkg_count"
29 if (( $
+commands
[pacman
] )); then
30 kercmp
-q || short
"linux" "$(kercmp)"
33 if (( $
+commands
[systemctl
] )); then
34 if (( $(systemctl show -P NFailedUnits) )); then
35 systemctl
--no-pager list
-units -q --failed
39 # list sessions if possible
40 tmux list
-sessions 2>/dev
/null
|| true