LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神,可以点击顶部导航 Contact 按钮进行投稿。

Recommended books

Popular entries

使用 ThinkPad 键盘灯做邮件提醒

{撰文/lvscar}

ThinkPad 屏幕顶部的键盘灯(ThinkLight)很可爱,虽然起不了什么照明效果,但黑暗环境下挂在视线正中的一束幽幽冷光貌似真能给思考增添灵感。这灯和小红点一道构成了 THINK 味的重要调料。

Pidgin 有一个有趣的插件 blanklight,能在新 IM 消息到来时闪烁 ThinkPad 键盘灯以做提醒。我很喜欢这个插件,虽然其只能用于 IM 消息提醒,且只能闪烁固定的 3 次。

对于大多数用户来说,新邮件提醒应该比 IM 消息提醒更为重要。受 blanklight 的启发,我决定用 ThinkLight 来进行邮件提醒。

我的桌面环境是 Xfce 4,她的面板自带一个非常出色的邮件提醒插件 Xfce4 Mailwatcher 能同时监视多个邮件帐号,支持几乎所有邮件服务(IMAP、POP3、GMAIL、LocalMail...),并且能在监测到新邮件时执行指定程序。

我写了一个控制 ThinkLight 的小脚本,以 --start 作为参数运行时能让键盘灯一直闪烁,如果以 --stop 参数运行则检查小灯是否已经在闪烁,如果是则让其闪烁停止。让 Xfce4 Mailwatcher 在收到新邮件和点击图标时执行这脚本的两种运行方式。一套完美的 ThinkLight 邮件提醒系统就完成了 ;-)

用 Linux 的 ThinkPad 用户可以玩玩这个脚本 lightup,很简单的配置过程已经写在里面,请用文本编辑器查看。

ps1:

ThinkWiki 中列出了其他一些和 ThinkLight 有关的程序。

ps2:

GNOME 或 KDE 中有类似 Xfce4 Mailwatcher 的面板插件吗?

Read More:

26 Comments

  1. 1 xifs Commented @ 2009-07-15 15:54Reply to this comment

    很不错..这三个灯对我来说是完全的鸡肋.. 不如这样好好利用吧..

  2. 2 建四狼 Commented @ 2009-07-15 16:10Reply to this comment

    有mail notification, 我这一直在用着监控system mailbox http://www.nongnu.org/mailnotify/ 支持读 system mailbox 或者gmail,evolution,hotmail, yahoo mail等等

  3. 3 young001 Commented @ 2009-07-15 17:05Reply to this comment

    充分利用啊

  4. 4 Iven Commented @ 2009-07-15 17:29Reply to this comment

    我想让键盘上的 Scroll Lock 的灯闪闪……:)

  5. 5 wbsh Commented @ 2009-07-15 18:11Reply to this comment

    @Iven 我也想,谁有方案没?

  6. 6 jinuljt Commented @ 2009-07-15 18:28Reply to this comment

    那个处于硬盘灯和电池灯之间的那个早就被我改造成pidgin的im消息灯了。。。。

  7. 7 JimHu Commented @ 2009-07-15 18:38Reply to this comment

    唉,本本上就一个待机灯的飘。。。。

  8. 8 Aerowolf Commented @ 2009-07-15 18:52Reply to this comment

      支持原创!   但大多数人没有ThinkPad,建议哪位大侠参考一下http://dirac.org/linux/writing/lkmpg/2.6/chinese/lkmpg_chs/x1161.html,让Scroll Lock灯闪烁起来。   一来这个灯每个键盘上都有,二来平时基本没有什么用处。

  9. 9 billy Commented @ 2009-07-15 19:01Reply to this comment

    @jinuljt: 高人,怎么改造的阿,我也想试试

  10. 10 RRG Commented @ 2009-07-15 19:31Reply to this comment

    Xfce4 Mailwatcher的密码是明文保存的,晕晕

  11. 11 czyhd Commented @ 2009-07-15 19:50Reply to this comment

    那位大牛参考一下啊, http://topic.csdn.net/u/20081113/10/adfdd896-e7b3-437e-8e1e-9dbbeffb6ff3.html 这个需要管理员权限

    后面还有3个 http://blog.csdn.net/cceczjxy/archive/2008/06/25/2584796.aspx

  12. 12 snyh Commented @ 2009-07-15 21:55Reply to this comment

    试试 xset led on

  13. 13 lvscar Commented @ 2009-07-15 22:10Reply to this comment

    ;-) ,谢谢Iven的创意和snyh提供的命令,待会儿我会改进下这个lightup脚本,让它在没有ThinkLight的电脑上用键盘灯来进行提示.

  14. 14 pjq Commented @ 2009-07-15 22:30Reply to this comment

    !/bin/bash

    while [ true ];do sleep 0.3 echo "xset led on" xset led on sleep 0.3 echo "xset led off" xset led off done

    用上面可以实现基本的闪烁。

  15. 15 billy Commented @ 2009-07-15 23:18Reply to this comment

    找到这个 http://www.thinkwiki.org/wiki/Table_of_thinkpad-acpi_LEDs

    再加上正文提到的 http://www.thinkwiki.org/wiki/ThinkLight

    自己动手试试

    btw, 那个z灯是power light

  16. 16 chi Commented @ 2009-07-15 23:33Reply to this comment

    那个 xset led on 的方式在我的惠普本本上行不通……

  17. 17 黑日白月 Commented @ 2009-07-15 23:41Reply to this comment

    印象中有一个软件用到了 Scroll Lock 灯做消息提示……

    已经提供的包
    名称          : kadu-led_notify
    架构          : i586
    版本          : 0.6.5.2
    发行          : 1.fc11
    大小          : 26 k
    Repo          : updates
    语法          : Notification by Scroll Lock LED
    统一资源定位符: http://www.kadu.net
    许可证        : GPLv2
    升级          : Led_notify is a module to notify user of some events using Scroll Lock
                  : LED.
    

    没有 Scroll Lock LED 的人悄悄飘过……

  18. 18 lvscar Commented @ 2009-07-16 0:27Reply to this comment

    update: 正文中的lightup脚本在没有ThinkLight的电脑上会使用键盘ScrollLock灯进行闪烁提示. 不过貌似很多笔记本(包括thinkpad)都没有scrollLock ;-)

    还有条路子是直接写字符设备来控制灯, 不过这个得root用户或写个二进制warper才行。

    对比ThinkWIKI中收录的blink.sh脚本, lightup更适合作为独立命令被第三放邮件提醒程序直接调用。

  19. 19 Commented @ 2009-07-16 8:07Reply to this comment

    木有Thinkpad怎么办?

  20. 20 ebird Commented @ 2009-07-16 8:43Reply to this comment

    个人认为还是不要盯着scrolllock了~~~

    用win的也许会说scrolllock用不到,可linux是可以用到的哇~~~

    难道可以不启用scrolllock而让scrolllock灯闪么?

  21. 21 czyhd Commented @ 2009-07-16 11:06Reply to this comment

    ubuntu有个软件,叫ledcontrol,可以apt装,灯确实可以闪,但是我没学会怎么控制。。

  22. 22 Badsol Commented @ 2009-07-16 11:31Reply to this comment

    想知道gnome下面除了mail notification邮件提醒之外还有没有别的?因为这个十分的不好用,监控个evolution需要装个插件也就算了居然还需要开着evolution。那我要他有什么用呀?evolution自己也有新邮件提醒的功能哦,还有本想设置成pop3收信然后等有新邮件就用evolution打开,但是后来发现mail notification这东西没办法清除邮件的状态,造成都是新邮件,总是提示我。。。。郁闷。我还没有把邮件下载到本地的习惯,一般都是放在服务器上存储。

  23. 23 Badsol Commented @ 2009-07-16 11:32Reply to this comment

    还有就是想问问大家gnome下面有没有那个邮件软件支持,从本地的收回站删除后在服务器上进行删除这个功能呀。

  24. 24 jinuljt Commented @ 2009-07-16 12:02Reply to this comment

    @billy 原来z灯是power. 好傻好天真,有电池灯和交流电灯还不够嘛……

  25. 25 jinuljt Commented @ 2009-07-16 12:04Reply to this comment

    @billy 你已经找到你想要的了。

  26. 26 kent.zhu Commented @ 2009-07-16 14:13Reply to this comment

    遗憾了,有XP下的吗?