Ubuntu消息通知在哪找
小樊
42
2025-12-07 10:42:03
Ubuntu 消息通知位置与查看方法
一、默认位置与显示方式
- 在 Ubuntu 桌面(GNOME/Unity 等)中,通知通常以气泡形式出现在屏幕的右上角,显示数秒后自动消失。
- 旧版 Ubuntu 14.04/14.10 可通过“最近通知工具(indicator-notifications)”在顶部面板保留历史记录:安装命令为
sudo add-apt-repository ppa:jconti/recent-notifications
sudo apt-get update
sudo apt-get install indicator-notifications
安装后重新登录即可在顶部面板看到历史通知图标。
二、在系统设置中查看与调整
- 打开:设置 → 通知(Notifications)。
- 可进行的操作:
- 全局开启/关闭通知,或按应用单独设置(允许/禁止、声音、横幅/弹窗等)。
- 若某应用没有通知,检查是否被设置为关闭;需要时再开启即可。
三、查看历史通知与通知中心
- 需要查看错过的通知或统一管理时,可安装第三方“通知中心”:
- Linux Notification Center(deadd-notification-center):支持自定义样式与行为。
- Ubuntu/Debian 手动安装示例:
wget https://github.com/phuhl/linux_notification_center/releases/download/1.7.2/linux_notification_center-1.7.2.tar.gz
tar -xvzf linux_notification_center-1.7.2.tar.gz
cd linux_notification_center-1.7.2
sudo apt-get install gtk3 gobject-introspection-runtime
sudo make install
启动:在终端运行 deadd-notification-center;配置文件位于 ~/.config/deadd/deadd.yml,样式文件 ~/.config/deadd/deadd.css。
- 旧版 Ubuntu 14.04/14.10 可用 indicator-notifications 保留历史记录(见上)。
四、终端与登录时的消息位置
- 终端登录的“每日消息 MOTD”:仅在文本模式登录时显示,内容由 /etc/update-motd.d/ 脚本动态生成;图形界面登录不显示。需要自定义时,可在 /etc/motd.tail 添加静态文本(登录时附加到 MOTD 末尾)。
- 通过计划任务发送桌面通知时,注意设置环境变量(示例):
export DISPLAY=:0.0
export XAUTHORITY=/home/你的用户名/.Xauthority
notify-send “提醒内容”