我想写一些反对libnotify的代码,但与libnotify perl的文档是认真缺乏。那么到2011-08-26为止,是否比libnotify“更好”呢?我需要的只是在Linux机器上发送通知给当前登录的用户(特别是Ubuntu)。有没有比libnotify更好的东西?
4
A
回答
4
Gtk2::Notify
似乎缺乏好的文档,但你可以通过一些例子在http://cpansearch.perl.org/src/FLORA/Gtk2-Notify-0.05/examples/浏览包括基本的一个:
#!/usr/bin/perl
use strict;
use warnings;
use Gtk2::Notify -init, 'Basic';
my $n = Gtk2::Notify->new('Summary', 'This is some sample content');
$n->show;
实际上这看起来很酷,我很快就可以使用它!感谢您的关注。
否则:
在Linux上,你可以使用zenity
发送弹出消息,并把它发送给你有一些环境变量玩其他用户的屏幕,但它可以做到的。从Perl我会设置适当的%ENV
值,然后执行system
或反拨(“`)调用zenity
。
也许从这里开始http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html
也是从那个链接中,也许libnotify-bin
/notify-send
也将工作,这取决于您发送的消息。
perl -E '$ENV{DISPLAY} = ":0.0";`notify-send "Hello World"`;'
-1
从我搜查,移植从Windows到Linux的应用程序时,有没有:(
我会很高兴到这里,如果有
更新:事实上,我在谈论libinotify和。不是libnotify
0
据我所知,freedesktop规范包含可通过dbus访问的通知服务。 以下是该功能的perl module的链接。
相关问题
- 1. 有没有比reCaptcha更好的东西?
- 2. 在OSX中有没有比Navicat更好的东西?
- 3. Perl:有没有比$ var = $ _;更好的东西?
- 4. 有没有比访问控制列表(ACL)更好的东西?
- 5. SCJP有没有什么好东西?
- 6. 当时间非常关键时,有没有比NSTimer更好的东西?
- 7. 有没有比HTML5 localStorage更大的东西?
- 8. pytest 3.x有没有比2.x更重要的东西?
- 9. 比Sprite/BufferedImage更有效的东西。
- 10. 有没有像''的东西?
- 11. 在命令行上进行HTTP测试,有没有比cURL好的东西?
- 12. 比get_headers()更快的东西()
- 13. 有没有比NSCoder编码和解码所有东西更好的方式来保存自定义类到NSUserDefaults?
- 14. 有没有比CGContext更好的选择?
- 15. 有没有办法用更友好的东西取代http:// localhost:3453?
- 16. 有没有Perabyte这样的东西?
- 17. C有没有像PHP ob_start的东西?
- 18. Haskell有没有像Incanter的东西?
- 19. 有没有像Codecademy for Java的东西
- 20. 有没有像Acegi for PHP的东西?
- 21. 有没有像WMI for Linux的东西?
- 22. SQLite有没有像insert_id的东西?
- 23. sed没有替换所有的东西
- 24. 有没有像DatastoreOutputWriter的东西?
- 25. 有没有像.gitonlytrackfiles的东西?
- 26. 有没有像RightMark for Linux的东西?
- 27. SASS里有没有像“+ =”的东西?
- 28. C有没有像IDLE(python)的东西?
- 29. 有没有像GraphEdit for MediaFoundation的东西?
- 30. 有没有像pmax索引的东西?
哪里有libinotify的perl接口?你有链接吗? –
也是在终端或x会话的用户? –
@Joel [Gtk2 :: Notify](http://search.cpan.org/dist/Gtk2-Notify)提供了与libinotify的连接。用户将在X会话中。 –