From: Siraaj Khandkar Date: Thu, 29 Sep 2022 10:37:42 +0000 (-0400) Subject: Log dmesg errors and warnings X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=1bce1dbc90a207613685fd997b310a48ebd98b6f;p=khome.git Log dmesg errors and warnings --- diff --git a/home/.xlaunch.d/99-dmesg-notifier-error b/home/.xlaunch.d/99-dmesg-notifier-error index 40a2d10..be28707 100755 --- a/home/.xlaunch.d/99-dmesg-notifier-error +++ b/home/.xlaunch.d/99-dmesg-notifier-error @@ -2,9 +2,14 @@ set -e +DIR="$HOME/var/log/dmesg" +FILE="$DIR/error.log" + +mkdir -p "$DIR" sleep 3 # wait for dunst to hopefully restart -sudo dmesg --follow --level=emerg,alert,crit,err --since=now \ -| while read line +sudo dmesg --follow --level=emerg,alert,crit,err --since=now --ctime \ +| while read -r line do notify-send -u critical 'dmesg error' "$line" + echo "$line" >> "$FILE" done diff --git a/home/.xlaunch.d/99-dmesg-notifier-warn b/home/.xlaunch.d/99-dmesg-notifier-warn index a021734..f5409c2 100755 --- a/home/.xlaunch.d/99-dmesg-notifier-warn +++ b/home/.xlaunch.d/99-dmesg-notifier-warn @@ -2,9 +2,14 @@ set -e +DIR="$HOME/var/log/dmesg" +FILE="$DIR/warning.log" + +mkdir -p "$DIR" sleep 3 # wait for dunst to hopefully restart -sudo dmesg --follow --level=warn --since=now \ -| while read line +sudo dmesg --follow --level=warn --since=now --ctime \ +| while read -r line do notify-send -u low 'dmesg warning' "$line" + echo "$line" >> "$FILE" done