通过notify-send发送正常紧急通知

alm*_*lmk 5 python command-line notify-osd irssi 15.04

我目前使用的是 15.04 (Vivid Vervet),我似乎无法收到任何要显示的通知,除非它们是在紧急程度设置为“严重”的情况下发送的,如下所示:

notify-send -u critical "IRC" "This is a critical IRC notification

与此不同,它不起作用:

notify-send -u normal "IRC" "This is a normal IRC notification"

我使用它作为测试来排除irssi-libnotify 的故障,它正确地将通知发送到服务器,但它们没有显示,因为它们是正常紧急的。我宁愿不修改 python 脚本作为解决方法,因为这可能是未来软件包的问题。

A.B*_*.B. 3

正确的语法是

notify-send [OPTIONS] <summary> [body]
Run Code Online (Sandbox Code Playgroud)

例如:

notify-send -u normal "Hello World" "Have a nice day"
Run Code Online (Sandbox Code Playgroud)

看看man notification-send

如果您想使用其他库(在您的例子中为 irssi-libnotify)并且存在错误,请在GitHub上创建问题。


例子

notify-send -u critical "IRC" "This is a critical IRC notification"
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

  • 我不认为这是库的错误,但可能与操作系统有关。在 irssi-libnotify 和 notification-send 上,除非使用“-u critical”发送通知,否则不会显示通知。AB 建议的命令不起作用,但将“正常”替换为“关键”的同一命令显示正常。 (2认同)
  • 问题是我想要普通紧急通知,因为关键通知会在屏幕上停留三十秒并且无法关闭,这相当烦人。 (2认同)