Tag: notify send

通知 – 发送不工作,似乎很多错误

我正在尝试创建通知脚本,但它不起作用。 当我点击例如“控制+ alt + m”时,它应该弹出通知它,但它像默认,我不能改变任何东西。 我尝试使用一些命令进行notify-send,但它只是不起作用。 而另一个巨大的问题是它不能在全屏幕上工作,就像我在游戏中,我想点击“控制+ alt + m”并且它没有显示出来。 我什么都做不了,我试着写 – 关键仍然没有用。 需要帮助通知。 这是我的脚本: #!/bin/bash notify-send “Dota2 Heroes” -t 10000 PS默认值为5秒时间,-t 10000 = 10秒但不起作用,通知在5秒内消失

notify-send和terminal命令

我们以sudo apt-get install linux为例。 这是notify send命令:notify-send -i terminal Bash“execution complete” 我怎么能用整个sudo命令替换’bash’? 命令以粗体显示,标题为“执行完成”,在其下方显示为消息。 这将用作通知手段。 命令完成后,会出现显示消息的通知。 其他人使用“; alert”来利用notify-send。 notify-send -i terminal Bash“执行完成”被保存为别名’alert’,为了方便起见,我想添加到别名中。

notify-send仅适用于sudo

问题 sudo notify-send Test “Hello World” 按预期显示通知。 notify-send Test “Hello World” 不显示通知。 更多的信息 Ubuntu版本16.04。 通知似乎使用notify-osd而不是notification-daemon。 运行notify-send似乎在运行notify-send的用户下启动notify-osd进程。 我不确定dbus是什么。 没有错误消息 syslog中没有错误。 当我运行以下代码时,不会出现错误消息。 #include #include int main() { gboolean x = notify_init (“Hello world!”); printf( “notify_init: %d\n”, x ); NotifyNotification * Hello = notify_notification_new (“Hello world”, “This is an example notification.”, “dialog-information”); GError *err = NULL; x = […]

是否可以取消或清除使用notify-send创建的通知?

所以我写了一个小脚本,确保某个用户在登录时插入笔记本电脑(如果没有则禁用)。 该脚本使用notify-send告诉他将其插入。如果他将其插入,脚本将退出。 是否可以在插入通知时自动清除通知? 我想它可能需要以某种方式获取由notify-send产生的进程id并杀死该PID,但我不知道如何做到这一点。 这是当前的脚本: #!/bin/bash cat /sys/class/power_supply/BAT0/status OUTPUT=”$(cat /sys/class/power_supply/BAT0/status)” echo “${OUTPUT}” if [ “${OUTPUT}” = “Charging” ] || [ “${OUTPUT}” = “Unknown” ]; then echo charging or full elif [ “${OUTPUT}” = “Discharging” ]; then notify-send -i /home/evamvid/Documents/Programming/OokiNoUse/power25.png “Hey there brother” “plug it in” COUNTER=0 while [ “$COUNTER” -le 12 ] do cat /sys/class/power_supply/BAT0/status […]

在用户不安全地拔下USB拇指驱动器时提醒用户

用户反复抱怨USB拇指驱动器上的数据丢失后,如果没有卸载则拔掉它们。 我们在我们的机器上运行Ubuntu 14.04 LTS。 启用自动安装。 由于我已经厌倦了在拔掉插头之前记住它们进行安全移除,因此我想在拔出已安装的USB驱动器时让Ubuntu显示警报。 我考虑添加一个udev规则,在驱动器仍然挂载的情况下运行notify-send 。 如何确定卸下后是否安装了USB驱动器?

如何在notify-osd中强制新的通知显示而不等待先前的退出?

我已经创建了一个脚本(以及一个导致此脚本的.desktop快捷方式)来启动和停止xampp … 它会检查xampp的状态,并相应地启动或停止xampp。 现在我已经在脚本启动时分配了一个通知,显示“正在开始xampp …”或“正在停止xampp …”,然后当xampp启动或停止时,它会显示“Xampp started …”或“ Xampp停了……“ 我已经使用notify-send来显示通知,如下面的脚本所示 现在问题是,在这里,第二个通知等待第一个消息然后弹出,即使xampp已经启动/停止。 我希望通过强制先前的通知在其生命周期完成之前退出来立即显示新通知。 当您立即激活/停用无线/网络时,可以看到这一点… 例如,选择启用无线时会出现“启用无线”,如果您立即选择禁用无线,则会出现“无线禁用”通知,而不等待“无线启用”通知完成其生命周期。 那我该怎么做呢? #!/bin/sh SERVICE=’proftpd’ if ps ax | grep -v grep | grep $SERVICE > /dev/null then notify-send -i /opt/lampp/htdocs/xampp/img/logo-small.gif “Stopping XAMPP…” && gksudo /opt/lampp/lampp stop && notify-send -i /opt/lampp/htdocs/xampp/img/logo- small.gif “XAMPP Stoped.” else notify-send -i /opt/lampp/htdocs/xampp/img/logo-small.gif “Starting XAMPP…” && gksudo /opt/lampp/lampp […]

每次特定应用程序发出通知时执行脚本

我搜索了一下安静,但所有的文章和答案只告诉你如何创建自己的通知。 我想要做的是跟踪所有应用程序发出的所有通知,并在每次发出特定通知时执行特定脚本。 我会写我的程序来做这件事。 我需要帮助的是如何“拦截”通知。

是否存在暂时隐藏通知的“请勿打扰”选项,例如在macbooks上?

是否存在“请勿打扰模式”,就像OSX设备一样,您可以决定通知何时可以打扰您。 我刚刚安装了chrome,我通常会被群组文本和其他通知发送垃圾邮件,这在我尝试工作时会很烦人。在我的Macbook上我可以选择打开“请勿打扰”,这会使所有forms的通知无效。 Ubuntu有类似的东西吗?

Notify-send在crontab中不起作用

我制作了一个脚本,当我正在阅读漫画的新章节时,它应该通知我。 我使用命令notify-send来执行此操作。 当我试图在终端中运行它时,该程序工作。 通知正在显示。 但是,当我将它放在我的crontab中时,通知不会显示。 我很确定该程序正在运行,因为我为它创建了一个文件。 该文件已创建,但通知未显示。 这是我的剧本 #!/bin/bash #One Piece Manga reminder #I created a file named .newop that contains the latest chapter. let new=$(cat ~/.newop) wget –read-timeout=30 -t20 -O .opreminder.txt http://www.mangareader.net/103/one-piece.html if (( $(cat .opreminder.txt | grep “One Piece $new” | wc -l) >=1 )) then (( new+=1 )) echo $new echo $new […]

如何显示crontab触发的notify-send消息?

test.sh:/ /usr/bin/notify-send “test” 以下工作: bash ~/Documents/test.sh 但是crontab从不显示通知。 为什么? */1 * * * * bash ~/Documents/test.sh