]> git.rmz.io Git - dotfiles.git/blob - zsh/lib/motd.zsh
awesome: tidy background.svg
[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 [[ -d ~/org ]]; then
14 # 44 seems to be the number of color escape characters used by grep
15 todo | cut -c-$((COLUMNS + 44))
16 fi
17
18 if (( $+commands[checkupdates] )); then
19 # checkupdate.service populates this db
20 pkg_count=$(CHECKUPDATES_DB=/tmp/checkup-db-0 checkupdates -n | grep -cv '\[.*\]')
21 if (( $pkg_count > 0 )); then
22 short "Outdated packages: $pkg_count"
23 fi
24 fi
25 if (( $+commands[pacman] )); then
26 kercmp -q || short "linux" "$(kercmp)"
27 fi
28
29 if (( $+commands[systemctl] )); then
30 if (( $(systemctl show -P NFailedUnits) )); then
31 systemctl --no-pager list-units -q --failed
32 fi
33 fi
34
35 # list sessions if possible
36 tmux list-sessions 2>/dev/null || true