小编The*_*Ret的帖子

libotify / notify-send:如果正文包含“<”或“>”,则不打印正文

我使用的是 Linux Mint 18.1,MATE。

我正在使用 notify-send 命令来可视化键的名称(例如<enter>),同时通过 python 脚本将它们发送到当前窗口。大约两周以来,notify-send 显示出一种奇怪的行为。我知道 bash 的基本语法是notify-send [OPTIONS] <summary> [body].

基本问题

执行时notify-send -t 0 '<enter>' 'text body',一切看起来都很好: 在此处输入图片说明

但是,当尝试使用 打印消息正文中的密钥名称时notify-send -t 0 'Summary' '<enter>',我得到:

在此处输入图片说明

同样的情况发生在notify-send -t 0 'Summary' '<', notify-send -t 0 'Summary' '>'notify-send -t 0 'Summary' \<

如果正文包含 < 或 > ,为什么正文打印为空白有什么想法吗?


解决方法(失败)

我尝试使用 python 模块代替:

from gi.repository import Notify
Notify.init("App Name")
Notify.Notification.new("Summary","<enter>").show()
Run Code Online (Sandbox Code Playgroud)

但结果与上图 2 中的结果相同。


附加信息:

zenity --info --title='Summary' --text='<enter>'在 bash …

libnotify notify-send

2
推荐指数
1
解决办法
1678
查看次数

标签 统计

libnotify ×1

notify-send ×1