让pidgin用上adium主题

(注:使用一周后,本人重装系统后,好像就不可用了,不过本人未装编译环境,有可能是缺少某些lib导致不可用,也懒得去验证了,谁知道的就说一声吧)

太兴奋了,昨晚,因为pidgin的聊天窗口支持主题了,

神马主题?adium主题啊,有木有?

其实pidgin的webkit主题插件,早在09年11月的时候就修复了,可是在CSDN的一个教程里面,下载源码的地址,却写错了,这样就导致国人很多按照教程之后,没法成功实现。

今天按照新的方法,模块化编写如下教程。有些步骤,的生成文件,我提供下载。如果不可用,请自行编译。

注:本教程为linux下完成。本人已经在Ubuntu11.04下测试通过。原教程提及的Fedora 12的相关命令,会按照推测写出

一、教程原文地址

Adium主题让你的pidgin更美(错误版)

pidgin使用adium主题最新版(修正版)

 

二、教程大致步骤

  1. 下载源码
  2. 编译安装插件
  3. 下载安装主题
  4. 配置插件使用主题
  5. 设定主题自动安装(可不做)

 

一)下载源码

下载源码需要使用 bzr 工具读取,这个工具是一种其实类似与 SVN 版本控制系统的工具,不解释。

1、Ubuntu 11.04 下命令安装该工具:

sudo apt-get install bzr

2、Fedora 下命令行安装该工具:

su yum install bzr

通过bzr工具下载源码

bzr branch lp:~pdffs/pidgin-webkit/karmic-fixes

得到 karmic-fixes 文件夹,这个文件夹内的就是 pidgin-webkit 的修正源码。

如果不想安装 bzr 工具,可以下载我已经打包好的修正源码,下载地址如下:

 

二)编译安装插件

编译这个插件,需要安装需要一下开发库:

1、ubuntu :pidgin, libnotify-bin, libpurple-dev, pidgin-dev, libwebkit-dev,命令安装如下:

sudo apt-get install pidgin libnotify-bin libpurple-dev pidgin-dev libwebkit-dev

2、fedora:libnotify,libnotify-devel,pidgin-libnotify, libpurple, libpurple-devel, pidgin-devel, pywebkitgtk, webkitgtk, webkitgtk-devel,命令安装如下:

su yum install libnotify libnotify-devel pidgin-libnotify libpurple libpurple-devel pidgin-devel pywebkitgtk webkitgtk webkitgtk-devel

安装完如上开发库,就可以进行编译了。命令如下:

cd karmic-fixes
make

编译完成后,得到 pidgin 插件 webkit.so 。若不想自行编译的,可下载我提供的 webkit.so 文件,下载地址如下,解压可得 webkit.so :

webkit.so.zip (53.97K)

将编译得到的 webkit.so 文件,复制到 ~/.purple/plugins 目录下,如没有这个目录,则自己建了一个。

注:若使用我提供的webkit.so无法使用请自行编译。

 

三)下载安装主题

打开如下网址:

http://www.adiumxtras.com/index.php?a=search&cat_id=5

找到喜欢的主题,download,得到主题压缩包。

解压主题文件,得到主题文件夹。

将主题文件夹移动到 ~/.purple/message_styles 目录下,如没有这个目录,则自己建了一个。

注,主题内必须带有 Template.html 模版文件,如没有,可以到 karmic-fixes 文件夹内,找到相应的文件覆盖过去即可。

 

四)配置插件使用主题

打开 pidgin ,

在 pidgin 的 Tools (工具)>  Plugins(插件)中,

勾选中 ” Webkit message styles “插件,

点击“Configure plugin(配置插件)”选择已下载的主题。(有时候这一步会崩溃,多尝试几次就好了,我想你也不会经常去换主题吧)

确定即可。

接下来你聊天的时候,聊天窗口即会使用相应的主题。

注:据说更换主题,需要重启 pidgin 才可生效,本人未验证。

 

五)设定主题自动安装(本人未验证)

是不是觉得每次下载主题还要解压,然后放到某某目录下很麻烦?好吧,接着看下面,可以给你解决这个难题。

编写一个文件,命名为 adium-install.sh ,里面内容如下:

#!/bin/bash
# Adium theme AdiumMessageStyle installer for Empathy
# Originally © 2009 Antono Vasiljev
# Licensed under the same terms as Empathy
# http://antono.info/en/165-install-adium-themes-to-empathy
# Changed by Vertlo Oraerk (did not work with directories containing spaces in the names)
# Changed by h!v from ubuntuforums to work with Pidgin+libwebkit and Notifications
# On Ubuntu you need to install libwebkit and libnotify-bin to get it working properly
# Further info on how to get working adium themes in Pidgin at http://www.webupd8.org/2009/05/pidgin-webkit-plugin-adium-conversation.html
# 02-12-2010 - Support for Adium 1.0 sound themes added. Hooha!
# Sound themes are supported in 2.6.x versions. If there's no file set for event, Pidgin falls to default sound file.
#   IM
#Message Sent = send_im
#Message Received (New) = first_im_recv
#Message Received = im_recv
#   Chat
#Message Sent = send_chat_msg - you send a message in a chat
#Message Received (Group Chat) =  chat_msg_recv - someone else sends a message in a chat
#You Are Mentioned = nick_said - someone says your username in a chat
#   Status
#Contact Signed On = login
#Contact Signed Off = logoff
#Contact Joins = join_chat - a person enters a chat
#Contact Leaves = left_chat - a person leaves a chat
types[0]="<key>Message Sent</key>"
types[1]="<key>Message Received (New)</key>"
types[2]="<key>Message Received</key>"
types[3]="<key>Message Sent</key>"
types[4]="<key>Message Received (Group Chat)</key>"
types[5]="<key>You Are Mentioned</key>"
types[6]="<key>Contact Signed On</key>"
types[7]="<key>Contact Signed Off</key>"
types[8]="<key>Contact Joins</key>"
types[9]="<key>Contact Leaves</key>"
events[0]="im_sent"
events[1]="first_im_recv"
events[2]="im_recv"
events[3]="send_chat_msg"
events[4]="chat_msg_rec"
events[5]="nick_said"
events[6]="login"
events[7]="logoff"
events[8]="join_chat"
events[9]="left_chat"
# Creating a file
if [ -z $1 ]
then
    echo
    echo "Usage:"
    echo "`basename $0` adiumxtra://some.url.here/extra"
    echo
    exit 1
else
    TMPDIR=`mktemp -d`
    XTRAURL=`echo $1 | sed -e "s/^adiumxtra:/http:/"`
    DEST="$HOME/.purple/message_styles/"
    if [ ! -d $DEST ]
    then
        mkdir -v -p $DEST
    fi
    cd $TMPDIR
    notify-send "File this"  "for Adium to be seems" --icon=pidgin
    wget --no-verbose -O xtra.zip $XTRAURL
    unzip -qq xtra.zip
    ls -d ./*.AdiumMessageStyle/ > themes_to_copy.lst
    ls -d ./*.AdiumSoundset/ > sound.lst
    num_bytes=`wc -c themes_to_copy.lst | sed 's# themes_to_copy.lst##'`
    sound=`wc -c sound.lst | sed 's# sound.lst##'`
    NAME=`cat themes_to_copy.lst | cut -f 2 --delimiter='.' | cut -f 2 --delimiter='/'`
    NAME_S=`cat sound.lst | cut -f 2 --delimiter='.' | cut -f 2 --delimiter='/'`
    if [ $num_bytes = 0 ]
    then
        if [ $sound = 0 ]
        then
             notify-send "All here I found"  "gibberish was" --icon=pidgin
        else
            while read line_
            do
                if [ ! -d $line_/Sounds.plist ]
                then
                notify-send "Found I theme"  " $NAME_S " --icon=pidgin
                DEST="$HOME/.purple/themes/$NAME_S/purple/sound/"
                if [ ! -d $DEST ]
                then
                    mkdir -v -p $DEST
            fi
                # Creating a file
            touch theme.xml
            echo -e "<?xml version="1.0" encoding="UTF-8"?> ">> $line_/theme.xml
            echo -e "<theme type="sound" name="$NAME_S">" >> $line_/theme.xml
            while read line
            do
                if [ "$line" = "<key>Info</key>" ]
                then
                    read line
                    inf=`echo $line | sed -e "s/<string>//" | sed -e "s/</string>//"`
                    echo -e "t<description>$inf</description>" >> $line_/theme.xml
                fi
                for ((j=0; j<=9; j++))
                do
                    if [ "$line" = "${types[j]}" ]
                    then
                       read line
                        file=`echo $line | sed -e "s/<string>//" | sed -e "s/</string>//"`
                        echo -e "t<event name="${events[j]}" file="$file"/>" >> $line_/theme.xml
                    fi
                done
            done < $line_/Sounds.plist
            echo -e "</theme>" >> $line_/theme.xml
            echo cp -r '$line_'* $DEST | sh
            else
                notify-send "Use I force could"  "none effect, that made" --icon=pidgin
            fi
            done < sound.lst
        fi
    else
        while read line
        do
            echo cp -r '$line' "$DEST" | sh
        done < themes_to_copy.lst
        echo
        notify-send "Installed I"  " $NAME for you " --icon=pidgin
    fi
    rm -r xtra.zip
    rm -r $TMPDIR
fi
exit 0 

若你的系统用户名为 user ,该文件保存在该用户的根目录下,则完整路径为 /home/user/adium-install.sh 。

执行以下命令。

cd /home/user
chmod 755 adium-install.sh
gconftool-2 -t string -s /desktop/gnome/url-handlers/adiumxtra/command "/home/user/adium-install.sh %s"
gconftool-2 -t bool -s /desktop/gnome/url-handlers/adiumxtra/enabled true
gconftool-2 -t bool -s /desktop/gnome/url-handlers/adiumxtra/needs_terminal false

注:以上步骤请将 user 换成您的系统用户名。

经过这个步骤之后,打开这个网址,当点击主题页面中的“Install”后,该脚本会自动下载主题并安装到/home/user/.purple/message_styles目录内,实现自动安装。

然后自行到 pidgin 内配置主题。如何配置主题,请看第四点。

 

注,晚上补图,昨晚太晚发现了,忘了截图,只是记得备份了源码以及编译好的weikit.so插件。

晚不上,发现刚装的Ubuntu没有截图工具,还有很多未配置,所以未能上图,需看图的,可参考这里

{ 发表评论? }

  1. zwwooooo

    沙发!

      • zwwooooo

        ak偶尔会,难道我太勤评论了?囧~

  2. 灵亦

    用上了 :mrgreen:

  3. OSMSG开源资讯

    话说 兄弟这也太乱了,转贴还得整理 :cry: :cry: :cry: :cry:

  4. elaphent

    额,又得去折腾了 :sad:

  5. 立青

    都是能折腾的人,厉害

  6. youanan

    请问一下在windows下可以用这主题吗

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Pingback & Trackback

  1. Pidgin使用adium主题_Ubuntu桌面美化 | UbuntuSoft - Pingback on 2011/05/05/ 15:16