Debian消息提醒设置指南
一 桌面即时通知 notify-send
二 定时与周期提醒
#!/usr/bin/env bash
set -e
if ! command -v at >/dev/null 2>&1; then
echo "请先安装 at:sudo apt install -y at" >&2
return 1
fi
case "$1" in
list)
at -l
;;
clear)
atrm $(atq | awk '{print $1}')
;;
*)
if [[ $# -lt 3 ]]; then
echo "用法:remind \"消息\" in 10 minutes|at 18:00"
return 1
fi
local msg="$1"; shift
local op="$1"; shift
local when="$*"
echo "notify-send $msg" | at "$op $when"
;;
esac
三 登录前后提示信息
四 通知守护进程与外观定制
五 系统级日志与邮件通知