GNOME-Shell Extension for Exaile DoubanFM Plugin

从有这个动机到基本可用,花了整整一天的时间。现在可以通过GNOME-Shell的一个小菜单从外部控制Exaile豆瓣电台了。它的意思就是说如果你使用Gnome-Shell,你可以把Exaile界面扔到一个你不想看到的地方去,比如第n+1个workspace。然后通过左上角的菜单来控制豆瓣电台的播放。见多识广的你不会对此感到太惊奇,其实它和Ubuntu上的Sound Menu Indicator类似,不过是专门给豆瓣电台设计的。
Exaile with doubanfm plugin

要实现这个功能,需要播放器通过dbus来expose一些接口供外部程序调用,它和Sound Menu是一样的,通过dbus来解耦。开发起来比较困难的是目前GNOME-Shell的API还不成熟,还没有文档,传统的javascript object inspect方法似乎在这个mozjs的环境里也不能用,所以实在是无从知道一些API。更不要提通过gjs来调用dbus了。网上有一些文档起了很大的作用,如果你也感兴趣,这些文章是:

支持dbus的exaile-doubanfm-plugin会在stable之后合并到主干供大家使用。现在和gjs一样,它的API也不稳定,所以放在分支中:
https://github.com/sunng87/exaile-doubanfm-plugin/tree/dbus

gnome-shell extension的代码现在也放在github上(其实还不成熟的东西放到bitbucket比较好的)。有兴趣可以了解:
https://github.com/sunng87/exaile-doubanfm-gnome-shell-extension

以上都是unstable,仅供吊胃口之用。

Douban is now available as a cover provider of CoverGloobus

This is a feature requested by a douban user, we need a provider for CoverGloobus to retrieve covers from douban.com

I just modify the code of exaile-douban-cover, and adapt to CoverGloobus 1.7 API. In 1.7, CoverGloobus has simplfied SPI for cover providers, which has much enhancement from 1.6 . So this provider is only compatible with CoverGloobus 1.7 .

The patch is now merged into the bazaar repository, you can find it at:

http://bazaar.launchpad.net/~gloobus-dev/covergloobus/trunk/files/head%3A/src/covers/

Chinese user will benefit from this patch that CoverGloobus will try to download album art if it’s not available from your music player.

Bash Color Support for Bti

Bti is well known as a command line twitter/identica/statusnet client, by Greg Kroah-Hartman.

I have been using this tool in CLI environment for a long time, found it difficult for human to parse output by eyes. So I forked it and added this bash color support, to provide some highlight on tweets.
bti-bash-color

To enable color support, add an option –auto-color to bti command, or append auto-color=yes to your configuration file($HOME/.bti)

I have sent pull request to Greg, hope the patch can be merged into master. Before approved, you can check out my fork and compile it yourself. (If liboauth not found, find it here.)

Visualize call tree of a C function

Requirement

You want to visualize a call hierarchy of a C function.

Solution

Utilities you need are listed below:

Take ‘rdbSaveBackground’ (redis/rdb.c) for example:

cflow --format=posix --omit-arguments --level-indent='0=\t' --level-indent='1=\t' --level-indent=start='\t' -m 'rdbSaveBackground' ~/osprojects/redis/src/rdb.c | cflow2dot | dot -Tjpg -o rdb.jpg

Output:
visualization of a call tree

Source: unix diary

The post is brought to you by lekhonee v0.7