我使用的是 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 …