还有比 libnotify 更好的东西吗?
我正在尝试针对 libnotify 编写一些代码,但是使用 libnotify 的 perl 文档严重缺乏。那么,截至 2011 年 8 月 26 日,有什么东西比 libnotify “更好”吗?我所需要的只是向 Linux 计算机(特别是 Ubuntu)上当前登录的用户发送通知。
I'm trying to write some code against libnotify, but the documentation for perl with libnotify is seriously lacking. So is there something that, as of 2011-08-26, is "better" than libnotify? All I need is to send a notification to the currently logged in user on a Linux machine (Ubuntu specifically).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Gtk2::Notify
似乎缺乏良好的文档,但您可以浏览 http://cpansearch.perl.org/src/FLORA/Gtk2-Notify-0.05/examples/ 包括基本的:事实上,这看起来很酷,我可以用它来做点什么很快!感谢您引起我的注意。
否则:
在 Linux 上,您可以使用 zenity 发送弹出消息,并将其发送到另一个用户的屏幕,您必须使用一些环境变量,但这是可以完成的。在 Perl 中,我会设置适当的
%ENV
值,然后执行system
或对zenity
的反引号 (``) 调用。也许从这里开始 http://www.cyberciti。 biz/tips/spice-up-your-unix-linux-shell-scripts.html
同样来自该链接,也许是
libnotify-bin
/notify-send
也可以工作,取决于您发送的消息。Gtk2::Notify
does seem to lack good documentation, but you can browse through some examples at http://cpansearch.perl.org/src/FLORA/Gtk2-Notify-0.05/examples/ including the basic one:In fact this seems pretty cool, I may use it for something soon! Thanks for bringing it to my attention.
Otherwise:
On Linux you can use
zenity
to send a popup message, and to send it to another user's screen you have to play with some environment variables but it can be done. From Perl I would set the appropriate%ENV
values and then just executesystem
or backtick (``) calls tozenity
.Perhaps start here http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html
Also from within that link, perhaps
libnotify-bin
/notify-send
would also work, depending on the message you are sending.根据我的搜索,当将应用程序从 Windows 移植到 Linux 时,没有:(
如果有的话,我很高兴来到这里。
更新:确实,我正在谈论 libinotify 而不是 libnotify。
From what I searched, when porting an application from Windows to Linux, there's no :(
I'll glad to here if there's.
Update: Indeed I was talking about libinotify and not about libnotify.
据我所知,freedesktop 规范包含一个可以通过 dbus 访问的通知服务。
以下是 perl 模块的链接 对于该功能。
As far as I can tell freedesktop specification contains a notification service which can be accessed via dbus.
Here is a link to a perl module for that feature.