解决方式 为了减少这种麻烦,可以使用notify-send,发送桌面通知。notify-send的使用非常简单,后面加上提示内容即可。 比如执行make的时候,就可以换成使用 make && notify-send "编译完成" 当然,每次还需要手工输入notify-send,也是挺麻烦。经常使用的话,可以封装成shell函数。 m() { make -j32 $@ && notify-send "编译完成" } 注意事项 如果是通过ssh登录到远程服务器上,则需要在ssh登录时,使用X11-forward才行,不然在远程使用 notify-send本地是看不到的。 "到点吃饭了" 其他 notify-send还有很多的参数,可以指定时间,图标等,有需要可查看帮助或上网搜索教程。
什么是notify-send?
notify-send - a program to send desktop notifications
怎么使用? NAME
notify-send - a program to send desktop notifications
SYNOPSIS
notify-send [OPTIONS ]
方法 因为我用的是ubuntu,用到提醒功能就让我想起了notify-send命令。 notify-send是一个可以让你发送桌面通知的命令. 它的语法非常简单: notify-send [其他选项...] 标题 [内容] 提醒解决了,那怎么实现定时功能呢。 实现方法 vi time.cron //创建一个cron脚本 输入 0 */1.5 * * * export DISPLAY=:0.0; notify-send ["该休息一下啦"] "喝水!
: print(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())) time.sleep(600) os.system("notify-send while :do sleep 600 echo time past notify-send 友情提醒 已经过了10分钟了 echo -e '\a'done ? 轮到NetCore了: 核心代码:Process.Start("notify-send", "友情提醒 10分钟过去了"); 原理说明:调用了ubuntu的notify-send的弹窗提醒,自己控制循环和定时 RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { Console.WriteLine("当前系统为Linux"); Process.Start("notify-send ", "友情提醒 10分钟过去了"); //用shell启动指定程序+命令 //Process.Start(new ProcessStartInfo("notify-send", "友情提醒 10分钟过去了
配合 notify-send 进行通知 ➜ ~ crontab -l 0-5/1 9 * * * notify-send "吃早饭了,boy!" 0-5/1 11 * * * notify-send "吃水果了,boy!" 0-5/1 13 * * * notify-send "吃午饭了,boy!" 0-5/1 15 * * * notify-send "吃下午茶了,boy!" 0-5/1 18 * * * notify-send "下班了,boy!" 保持更新,转载请表明出处。
https://www.cnblogs.com/dotnetcrazy/p/9111200.html#python 先NetCore吧:(old code:me) 核心代码:Process.Start("notify-send ", "友情提醒 10分钟过去了"); 原理说明:调用了ubuntu的notify-send的弹窗提醒,自己控制循环和定时 补充知识:RuntimeInformation.IsOSPlatform(OSPlatform.xxx : print(time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())) time.sleep(600) os.system("notify-send shell代码)【其实shell方便之处在于直接执行系统命令,系统获取时间:date,那shell加一行即可】 while : do date sleep 600 echo -e '\a' notify-send
包来使得系统能与Web Browser进行通信) 安装插件: notifications alert 消息提醒 permanent notification 消息提醒,不消失 在用户角色下面使用 notify-send
使用sensors获取系统温度 使用notify-send发送通知 ---- 实现 如何实现呢,很简单,略懂shell直接看代码temcheck.sh #! str=`sensors |awk '{print $2}'| sed -n '3p'` tem=${str:1:2} if [ $tem -gt 50 ] then notify-send
1. notify-send 命令 这个命令可以让你通过通知进程发送一个桌面通知给用户。这可以用来向用户发送提示,或者显示一些信息而不用打断用户工作。 你需要安装如下软件包: $ sudo apt-get install libnotify-bin 下面这个例子展示了如何从命令行向桌面发送一个简单的消息: notify-send "rsnapshot ‘{ print $5}’ | sed ‘s/,//g;s/\.[0-9]*//g’) [ $notify_counter -eq 0 ] && [ $live -ge $alert ] && { notify-send
下面是一个查看系统中命令别名的示例: $ alias alias alert='notify-send --urgency=low -i "$([ $?
Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $?
目录名 删除回收站的文件 或者解除临时绑定 unalias rm 输出: hc@hc-virtual-machine:/tmp/20181026111444$ alias alias alert='notify-send hc-virtual-machine:/tmp/20181026111444$ unalias rm hc@hc-virtual-machine:/tmp/20181026111444$ alias alias alert='notify-send
Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $?
Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $?
Darwin' ]; then osascript -e \"display notification \\\"$MSG\\\" with title \\\"Claude Code\\\"\"; else notify-send 'Claude Code' \"$MSG\"; fi; exit 0" }] }] }}适用于 macOS(osascript)和 Linux(notify-send)。 ); osascript -e \"display notification \\\"$MSG\\\" with title \\\"Claude Code\\\"\" 2>/dev/null || notify-send
Notify-send使我成为一个完美的工具,作为一个主要的GNOME用户(向下滚动以获取其他桌面环境的说明)。
日志 udev 能做的远不止管/dev,它可以联动各种工具,实现 “一站式设备管理”: 自动挂载:U 盘插入后,udev 触发mount命令,自动挂载到/media/usb; 发送通知:设备插入后,用notify-send
" 2.在成功检测到注入点时报警 参数:–alert 该参数用于在找到新的注入点时发出警报,后跟一个用于发出警报的命令,如: python sqlmap.py -r data.txt –alert “notify-send ‘找到漏洞了’“ 上例中用于发出警报的命令是Ubuntu中的notify-send命令 3.设置问题的回答 参数:–answers 使用“–batch”以非交互模式运行时所有问题都以按默认值作为回答。
可以使用'alias'命令检查当前别名: $ alias alias alert='notify-send --urgency=low -i "$([ $?
.在成功检测到注入点时报警 参数:–alert 该参数用于在找到新的注入点时发出警报,后跟一个用于发出警报的命令,如: python sqlmap.py -r data.txt --alert "notify-send (NOT)' injectable (with --not-string="001") [18:59:36] [INFO] executing alerting shell command(s) ('notify-send '找到漏洞了'') 上例中用于发出警报的命令是Ubuntu中的notify-send命令。