使用 WiFi ESSID 更新 Pidgin 状态信息

{ 撰文/lvyi }

不知道大家是怎么使用 IM 工具状态信息的,万年不变的签名档抑或当前播放歌曲名?

最近的习惯是把 IM 状态信息用来显示当前俺在哪,例如在家时显示"@home",在公司时显示"@office"。虽说 Pidgin 更换状态信息很方便,但咱死 coder 的一个特征就是对这种简单重复的事不爽。周末得空研究了下 Pidgin 的状态切换机制,写个了小脚本在上线时根据当前无线网络的 ESSID 自动更换状态栏内容。

使用方法很简单,用文本编辑器打开,变更一下 Pidgin 状态信息和其匹配的 ESSID。 把这脚本设置为可执行,放入桌面环境的启动自动运行列表里。登出,登入就 OK 了。

该脚本依赖 python-dbus,最近一两年的 Linux 系统基本都会默认安装吧。

下载:essidbasedpidgin_status.py

{ Source. Thanks lvyi. }

Read More:

21 Comments

  1. 1 ebird Commented @ 2010-01-11 12:26Reply to this comment

    有特色,虽然我用不上~~@_@

  2. 2 Commented @ 2010-01-11 12:38Reply to this comment

    我倒想知道怎麼讓歌曲信息支持moc

  3. 3 dongyuwei Commented @ 2010-01-11 13:31Reply to this comment

    网上有个perl脚本可以Use a Twitter feed as your status message。安装之前最好看看这个http://developer.pidgin.im/ticket/5428 

  4. 4 lvs Commented @ 2010-01-11 14:17Reply to this comment

    @dongyuwei 为什么你证明自己会用google时,能找得出这样毫无关系的链接?

  5. 5 dongyuwei Commented @ 2010-01-11 15:17Reply to this comment

    @lvs sorry. see: http://code.google.com/p/pidgin-twitterstatus/

  6. 6 黑日白月 Commented @ 2010-01-11 19:38Reply to this comment

    呃……跟随 GNOME 2.28 迁移到 Empathy 了……

    另外在 Pidgin 中没有找到拼写检查……

  7. 7 nacre Commented @ 2010-01-11 20:03Reply to this comment

    @黑日白月: empathy现在可不可以把多个联系人合成一个?

  8. 8 lvs Commented @ 2010-01-11 20:18Reply to this comment

    Pidgin里找联系人,,可以通过Buddies-New Instant Message,然后根据输入动态匹配联系人信息, 这个俺用得最多的功能empathy里没找到,,

  9. 9 黑日白月 Commented @ 2010-01-11 20:29Reply to this comment

    @nacre:

    不好意思,这个不知道是什么……

    我其实只用 Empathy 登录 IRC 和 GTalk……

    @lvs:

    在好友列表里什么都不用选,直接输入就会弹出浮动框动态匹配好友,跟在 Nautilus 里一样啊……

  10. 10 marklf Commented @ 2010-01-11 20:31Reply to this comment

    @黑日白月 我的Empathy里的QQ看不到群,你的有吗?

  11. 11 lvs Commented @ 2010-01-11 21:12Reply to this comment

    @黑日白月 我试了下,empathy只能找到未被折叠且当前显示的联系人,而且只能通过当前显示的名字匹配。 不知道有没有快速搜索所有联系人的插件. but ,empathy的DBUS接口倒是暴露得相当的完整.

  12. 12 黑日白月 Commented @ 2010-01-11 22:43Reply to this comment

    @marklf:

    没试过,我是用 WebQQ + Prism + Alltray 登录 QQ 的,省的 TX 老要激活……

    @lvs:

    Ctrl + H 显示所有联系人后试试……我太清楚你说的“折叠”是什么意思,抱歉……

    目前 Empathy 还没有插件框架……

  13. 13 Homer Commented @ 2010-01-11 23:53Reply to this comment

    挺好玩的脚本。顶一下~

  14. 14 nacre Commented @ 2010-01-12 1:45Reply to this comment

    @黑日白月: 就是假如你在不同协议中有同一个人的多个帐号,可以把所有的帐号拖到一起(Drag and Drop),合成一个联系人。

  15. 15 黑日白月 Commented @ 2010-01-12 7:47Reply to this comment

    @nacre:

    哦?很不错的功能,可惜我只用 Gtalk 和 IRC,无福消受此项功能……

  16. 16 lvs Commented @ 2010-01-12 9:16Reply to this comment

    今晚较为详细了看了下Empathy, 其只是Telepathy框架的一个前端而已,Telepathy设计得非常灵活,充分利用dbus使其可以很方便的把现有IM提供的沟通服务以任何形式嵌入到任何程序中,仅仅只用来做一个pidgin克隆,我真觉得有点大材小用了。通过UbuntuOne或类似服务提供的云存储和TelePathy封装的沟通网络.其实可以创造很多更有趣的应用出来, 欢迎感兴趣的朋友和我探讨.

  17. 17 dongyuwei Commented @ 2010-01-13 23:31Reply to this comment

    我写了段python脚本(也是通过pidgin的dbus接口),让远程pidgin IM 可以执行python代码(理论上可以执行任意脚本,目前只支持python),可以把pidgin当成VPN来使用。http://code.google.com/p/pidgin-vpn/

    1)修改trustedbuddylist = ["your_account@gmail.com"]。只执行自己信任的朋友发来的python 代码(消息) 2)发送的IM消息形如。中任意合法python 代码都会被执行(当然,有异常也会反馈错误结果给发送方)

  18. 18 dongyuwei Commented @ 2010-01-13 23:33Reply to this comment

    ubuntu下测试gtalk、msn、qq2008均可。一个IM帐号也可以测试(自己给自己发消息聊天吧,呵呵)。

  19. 19 lvs Commented @ 2010-01-14 10:38Reply to this comment

    @dongyuwei:

    呵呵,有意思

  20. 20 Eidolon Commented @ 2010-01-18 9:54Reply to this comment

    来这里的都是高人啊,请教个问题: 我有一块无线网卡,经常用它来给手机共享网络。不过,每次都要手工的敲命令。 我的问题是,能不能当我插入无线网卡时,自动运行我的脚本,将无线网卡切换到Ad-Hoc模式?我相信是可以的,但不知道在哪里配置。高人给个提示。谢谢。

  21. 21 lvs Commented @ 2010-01-20 18:09Reply to this comment

    @Eidolon: 这个需求不难实现,你查找一下NetworkManager的dbus接口,,写个小脚本监听插入无线网卡的信号,在监听到信号时,调用你的共享网络的脚本就可以了.