如何从 bash 脚本发送 KDE5 桌面通知?

int*_*_ua 17 notification command-line kde5

我尝试了多种选择,但都没有奏效:

notify-send 'text'
kdialog --passivepopup 'text' 5
qdbus org.kde.knotify /Notify event "event" 'app' "(" ")" 'title' 'text' 'pixmap' '' 5 0
Run Code Online (Sandbox Code Playgroud)

更新:前两个选项应该有效,在我的情况下,问题是自动隐藏面板的 KDE 错误:如果面板自动隐藏,则不会显示 KDE5 弹出通知

小智 16

在我安装 Kubuntu 15.10 和 KDE neon 时,notify-send在我安装libnotify-bin包之前,命令不可用。

安装libnotify-bin 后notify-send工作正常:

sudo apt-get install libnotify-bin
Run Code Online (Sandbox Code Playgroud)


int*_*_ua 14

至少前两个选项应该有效,我只是在 KDE 中遇到通知问题:https : //bugs.launchpad.net/ubuntu/+source/kde-runtime/+bug/1547752

notify-send 'text'
kdialog --passivepopup 'text' 5
Run Code Online (Sandbox Code Playgroud)