安装Exaile豆瓣电台插件及Gnome-Shell扩展

介绍一下新版本的Exaile豆瓣电台插件和新的GNOME-Shell扩展的安装。

下载

从github上下载相应的版本:

$ wget --no-check-certificate https://github.com/sunng87/exaile-doubanfm-plugin/zipball/0.0.10-dbus
$ wget --no-check-certificate https://github.com/sunng87/exaile-doubanfm-gnome-shell-extension/zipball/0.0.1
$ ls
sunng87-exaile-doubanfm-gnome-shell-extension-0.0.1-0-g5cc29c6.zip
sunng87-exaile-doubanfm-plugin-0.0.10-dbus-0-g90f7175.zip

解压安装

如果你已经安装过exaile豆瓣电台插件,可以先删除旧版本:

$ rm -rf ~/.local/share/exaile/plugins/doubanfm

解压缩下载的文件:

$ unzip sunng87-exaile-doubanfm-plugin-0.0.10-dbus-0-g90f7175.zip
$ unzip sunng87-exaile-doubanfm-gnome-shell-extension-0.0.1-0-g5cc29c6.zip

移动到指定的目录:

$ mv sunng87-exaile-doubanfm-plugin-90f7175/ ~/.local/share/exaile/plugins/doubanfm
$ mv sunng87-exaile-doubanfm-gnome-shell-extension-5cc29c6/ ~/.local/share/gnome-shell/extensions/exaile-doubanfm-gnome-shell-extension

配置

启动Exaile,通过菜单“编辑->首选项->插件”,激活doubanfm,禁用lastfm covers。如图设置插件:

重启GNOME-Shell,按下alt+f2,输入r,回车。

使用

启动exaile,可以通过文件菜单打开豆瓣电台频道。可以通过ctrl+d或者视图菜单切换到豆瓣电台视图:

当然也可以通过gnome-shell扩展的菜单控制豆瓣电台的播放。

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,仅供吊胃口之用。

Update on exaile-soundmenu-indicator and exaile-doubanfm-plugin

Exaile-soundmenu-indicator

As many users complaint about the “minimise to sound menu” issue, I updated exaile-soundmenu-indicator plugin. Now it is basically compliant with specification of SoundMenu: it will keep playing if you click the close button while the player is playing, and will exit if not playing. However, to be able to complete the functionality, you have to commentify the line 1506 of /usr/lib/exaile/xlgui/main.py, which is “return true” of method “delete_event” (On Ubuntu 10.10, exaile 0.3.2.0-ubuntu3). Otherwise, whenever you close the window it won’t exit.

I know this is a bad idea to require user to modify the source code, but it‘s not possible to override the behavior of a GTK callback, especially when you do not have the handler_id of the callback. If you do not mind the incompliant of closing behavior, you can just keep it as is, and exiting by menu and CRTL+Q.

Grab the snapshot of github repository to get the up-to-date version:
https://github.com/sunng87/Exaile-Soundmenu-Indicator

Exaile-doubanfm-plugin

Exaile豆瓣电台插件更新。豆瓣最近调整了登录的策略:

  • 用户在首次访问豆瓣时被设置cookie bid
  • 用户提交登陆表单时被要求提交cookie bid,否则不予通过。

此外,这次更新开始使用HTTPS提交用户登录信息。

https://github.com/sunng87/exaile-doubanfm-plugin,请下载最新0.0.6c。