什么是cygwin / Windows相当于Linux的'notify-send

时间:2013-04-26 02:50:55

标签: cygwin libnotify

Linux具有用于将用户通知发送到桌面管理器的命令notify-send。 (在许多环境中,这些显示为屏幕一角的弹出窗口,以及低电量警告和其他系统消息。)我在监视和备份脚本中使用它。

Cygwin似乎没有lib-notify,所以这个命令是否有Windows等价物?网络搜索引导我找到关于从Windows系统托盘/通知区域运行批处理文件的文章,或尝试从批处理文件中清理系统托盘,但我还没有找到一种方法从后台进程生成不显眼的用户消息。

3 个答案:

答案 0 :(得分:14)

您可以尝试notifu。它是一种命令行通知应用程序,因此您可以在cygwin中使用它。

用法:notifu /p title /m message

答案 1 :(得分:4)

自UNIX3中使用wall(1)命令后的NT3.51天以来,Windows已经具有此功能。对于Pre vista,7,8系统,命令为net send

net send * "Message"

在较新且专业的版本上,msg.exe

msg "%username%" "Hello World"
msg * "Message"

Samba甚至支持旧的通知协议:     echo" Hello world" | smbclient -NM HomePC

对于新发布的Vista版本,需要使用PsExec / winexe。有关详细信息,请参阅Ubuntu:SE Article on message to windows 7

答案 2 :(得分:2)

试试这个(适用于Windows 10 +):

https://github.com/Windos/BurntToast

通过Powershell安装(以管理员身份)

Install-Module -Name BurntToast
New-BTAppId
Import-Module BurntToast
New-BurntToastNotification

您可以通过执行powershell.exe -Command 'New-BurntToastNotification'

在Cygwin中运行Powershell命令