有没有办法查看通知历史记录?

Gon*_*oza 51 notification notify-osd software-recommendation

如果我离开我的电脑,那么我很有可能会错过某些通知。我在 KDE 中看到通知被存储和堆叠,直到您单击它们(或其他)。

除非我遗漏了什么,Ubuntu 似乎没有可点击通知的历史。

有没有办法做到这一点?

Jak*_*kob 26

获取最近的通知

截图最近的通知

在终端运行中:

sudo add-apt-repository ppa:jconti/recent-notifications
sudo apt-get update
sudo apt-get install indicator-notifications
Run Code Online (Sandbox Code Playgroud)

或者,您可以直接在launchpad-site上下载软件包。对于 i386 机器上的 Ubuntu 11.10 Oneiric,选择indicator-notifications_0.1.4-2~ppa~oneiric_i386.deb. (不要安装recent-notifications

安装后运行Alt+ F2 unity --replace.

您会在面板中找到一个小邮箱:

面板中的最近通知

可以将图标与您的桌面主题对齐,即当您使用 Faenza 时:

mkdir ~/.icons/Faenza/status/scalable
cp /usr/share/icons/Faenza/status/scalable/user-available-symbolic.svg ~/.icons/Faenza/status/scalable/indicator-notification-unread.svg
cp /usr/share/icons/Faenza/status/scalable/user-away-symbolic.svg ~/.icons/Faenza/status/scalable/indicator-notification-read.svg
Run Code Online (Sandbox Code Playgroud)

新的法恩扎图标

要阻止它,您需要卸载它:

sudo apt-get purge indicator-notifications
Run Code Online (Sandbox Code Playgroud)

然后再次运行Alt+ F2 unity --replace

要删除 ppa 运行:

sudo add-apt-repository -r ppa:jconti/recent-notifications
Run Code Online (Sandbox Code Playgroud)

  • 这可以在不添加另一个 PPA 的情况下完成吗?我认为我们很多人都尽可能避免这样做。 (7认同)

小智 22

此处链接的评论,有没有办法查看通知历史记录?,问道:

这可以在不添加另一个 PPA 的情况下完成吗?

是的


打开两个终端窗口 ( Ctrl+ Alt+ T+ T)。额外的窗口仅用于测试目的。


在终端窗口之一中监控通知

dbus-monitor "interface='org.freedesktop.Notifications'"    |     \
grep --line-buffered  "member=Notify\|string"
Run Code Online (Sandbox Code Playgroud)

(要停止它,请关闭窗口或键入Ctrl+ C

请注意,运行此脚本仅显示从它启动时发生的那些通知,并且必须在进程和 aps 之前运行。历史是需要的。如果终端窗口的回滚大小不足,请更改Edit > Profile Preferences > 中 的回滚行Scrolling或如下所述记录历史记录。

要将输出记录在永久日志中,只需通过添加到行尾将其重定向到文件 。记录和查看通知附加到行。>>path/filename.extgrep | tee >>path/filename.extgrep


测试一下。

  1. 使用 Pangolin 12.04 Live SD/USB
  2. 关闭和打开无线网络。
  3. 使用另一个终端窗口发出一些其他通知:
    对于 i 在 {0..100..20} 中;
         做
               killall 通知 osd;
               通知发送“测试 $i” $i;
               睡眠 0.5;
         完毕

结果

明智地使用grepsed等几乎可以打印在以下针对这些粗略地示出的通知监视的例子。与通知弹出气泡中的涂鸦相匹配的文本显示在 中bold。前面的两个字符串是 ap。使涂鸦(即“NetworkManager”或“notify-send”)和图标的名称(如果有)(即“notification-network-wireless-disconnected”)显示在弹出气泡中。

   字符串 ":1.380"
方法调用 sender=:1.14 -> dest=:1.379 serial=8691
                路径=/org/freedesktop/Notifications;
                         interface=org.freedesktop.Notifications; 成员=通知
   字符串“网络管理器”
   字符串“通知网络无线断开”
   字符串“ MissingLink ”
   字符串“已断开连接 - 您现在处于离线状态”
         字符串“紧急”
         字符串“瞬态”
方法调用 sender=:1.14 -> dest=:1.379 serial=8782 
                路径=/org/freedesktop/Notifications;
                         interface=org.freedesktop.Notifications; 成员=通知
   字符串“网络管理器”
   字符串“通知网络无线完整”
   字符串“ MissingLink ”
   字符串“已建立连接”
         字符串“紧急”
         字符串“瞬态”
方法调用 sender=:1.386 -> dest=:1.389 serial=7 
                路径=/org/freedesktop/Notifications;
                         interface=org.freedesktop.Notifications; 成员=通知
   字符串“通知发送”
   细绳 ””
   字符串“测试 0 ”
   字符串“ 0 ”
         字符串“紧急”

. . .

    方法调用 sender=:1.426 -> dest=:1.429 serial=7
                路径=/org/freedesktop/Notifications;
                         interface=org.freedesktop.Notifications; 成员=通知
       字符串“通知发送”
       细绳 ””
       字符串“测试 80 ”
       字符串“ 80 ”
             字符串“紧急”
    方法调用 sender=:1.430 -> dest=:1.433 serial=7
                路径=/org/freedesktop/Notifications;
                         interface=org.freedesktop.Notifications; 成员=通知
       字符串“通知发送”
       细绳 ””
       字符串“测试 100 ”
       字符串“ 100 ”
             字符串“紧急”

交叉引用:
...有待完成...

  • 把那个宝贝打包并放到发行版中 (2认同)