每当使用dbus-monitor收到桌面通知时,我都会尝试触发python脚本或shell脚本。
我以这种方式使用该命令
dbus-monitor "interface='org.freedesktop.Notifications'" | grep --line-buffered "string" | xargs -I '{}' python3 ./test.py {}在那之后,我尝试使用-> notify从另一个终端发送桌面通知-发送"hello“"world”
上述自定义通知的输出为
string "notify-send"
string ""
string "hello"
string "world "
string "urgency"
string "notify-send"
string ""
string "hello"
string "world "
string "urgency"但是如果这个命令的输出是10行,那么每行都会调用python脚本。
但我的期望是为每个通知调用一次python脚本,然后在一行中获得所有输出作为python脚本的参数。
https://stackoverflow.com/questions/68794467
复制相似问题