Awesome autostart

Problem

让Awesome环境像Openbox一样在启动时,在根上下文中执行一个autostart脚本(启动程序、声明环境变量)。

Solution

Ubuntu中GDM启动后会执行 /etc/gdm/Xsession 这个脚本,如果是custom会话(启动参数custom),会执行用户目录下的.xsession脚本,否则会执行 /etc/X11/Xsession.d/ 目录下的所有脚本。

为了支持autostart脚本,可以在 /etc/X11/Xsession.d/ 里创建一个新的脚本 55awesome-autostart

BASESTARTUP=$(basename "$STARTUP" | cut -d\  -f1)
if [ "$BASESTARTUP" = x-session-manager ]; then
    BASESTARTUP=$(basename $(readlink /etc/alternatives/x-session-manager))
fi
if [ "$BASESTARTUP" = "awesome" ]; then
    AWESOME_AUTOSTART=$HOME/.config/awesome/autostart.sh
    if [ -e "$AWESOME_AUTOSTART" ]; then
        . "$AWESOME_AUTOSTART"
    fi
fi

这个脚本会判断启动的session是否是awesome,如果是,并且autostart.sh存在的话,source这个文件。autostart.sh按照xdg的约定,放在配置文件目录 $HOME/.config/awesome/ 里。

这样,在用户目录下的配置文件里,就可执行一些自启动程序,或者声明环境变量,典型的应用就是指定awesome会话专用的gtkrc:

AWESOME_CONFIG_PATH=$HOME/.config/awesome
export GTK2_RC_FILES=$AWESOME_CONFIG_PATH/gtkrc

xcompmgr -cCfF -t-5 -l-5 -r4.2 -o.55 -D6 &
awsetbg -u feh -f .config/awesome/ubuntu.jpg

Installing Weather Indicator on Maverick

The appindicator has been enhanced again in Ubuntu 10.10 Maverick. The new datetime indicator has been introduced in the replace Gnome datetime applet. However, the datetime indicator is quite simple, which drops support for EDS (Evolution data server), location and weather. So you need an indicator api based weather widget, and omgubuntu says there is already such a project of weather-indicator, on launchpad.

indicator-weather

However, any attempt to install this package will result in a failure of 404. The ppa is no long maintained (Even the project has been in silent for a long time.) Fortunately, we can still build it from sources.

First, check out the sources with bzr:
bzr branch lp:weather-indicator

Then, change directory into weather-indicator, package it with debuild:
debuild binary

You will get the result in the parent directory:
indicator-weather_10.07.16_all.deb

Then you simply install the debian package with dpkg:
sudo dpkg -i indicator-weather_10.07.16_all.deb

Enjoy !

Exaile 豆瓣电台插件 0.0.5

趁热依旧打铁。Exaile 豆瓣电台插件 0.0.5

Features

  • 界面快捷键 加心f 跳过s 删除d
  • 调整了按钮的顺序,和官方一致
  • 增强的菜单,可以在豆瓣模式里切换频道、关闭Exaile,无须回到主界面
  • 推荐当前歌曲到豆瓣,可以在配置界面配置推荐语模板

Installation

Wiki page

Downloads

Download from Github

Screenshots

Douban Mode
screenshot_002

Enhanced Douban Mode Menu
screenshot_001

More ?

豆瓣 on Ubuntu

Exaile 豆瓣电台插件 0.0.4

趁热打铁, Exaile豆瓣电台插件今天又有了一些更新:

  1. 支持今天豆瓣新发布的摇滚、民谣、NewAge频道
  2. 支持Exaile 0.3.2开始的界面透明
  3. 与官方保持一致,在非个人频道时禁用trash按钮

下载
http://github.com/sunng87/exaile-doubanfm-plugin/downloads

很多朋友纠结于安装,安装确实稍显麻烦,大家注意:

  1. 确认你的Exaile版本0.3.2。
  2. 下载,重命名下载的文件为doubanfm.tar.gz(Exaile要求压缩包内的文件名要以压缩包的名字开头,否则报错;而github上使用相同的文件名用作下载会有潜在的问题)
  3. 如果已经安装过这个插件,请删除 rm -r ~/.local/share/exaile/plugins/doubanfm
  4. 打开Exaile,打开Preferences,到Plugins页,安装
  5. 勾选doubanfm
  6. 如果plugins树下没有出现Douban Radio,关闭Preferences重开,找到Douban Radio,设置用户名密码
  7. 重启Exaile
  8. 打开文件菜单,Open Douban.fm,选择你需要的频道
  9. 双击音轨或点击播放开始播放
  10. 切换到豆瓣视图,菜单View->Doubanfm Mode,或快捷键 Ctrl+alt+d

exaile douban radio
Enjoy!