Base info
- How to is based around modified script for Empathy. I tweaked it to make it working with notifications and other popular IM-app, Pidgin.
- All credits go to Antono Vasiljev and Vertlo Oraerk. You can get script for Empathy here.
- I modified it a little to not spew out errors. Notifications work. For something they are after all.
- If you find any issues, especially if you've found solution, be sure to post it. I'm visiting this thread at least once a week, I'll update thread or try to give a hand.
Message Themes
Keep in mind not every theme will work properly.
- Pidgin 2.7
Originally Posted by
TorontoStorm
I followed the guide, and the adium theme works sometimes. I'm not able to fully identify when it works, but it seems to be when I initiate the conversation with a contact, and not when they message me first. It also doesn't work if I close the conversation window, then open it again. Only a restart of Pidgin gets the adium theme back once that happens.
Workaround
Originally Posted by
TorontoStorm
I identified the source of my problem, and a temporary solution it it. If "Hide new conversations" is set "Always" or "When Away", if someone messages you, and Pidgin hides the window until you go to open it, it reverts to normal conversation rendering (not webkit) for the rest of the time pidgin is open, and only a restart will put it back to using webkit. The obvious workaround for now is to set that setting as "Never".
- You'll need Pidgin in version at least 2.6.X to support Sound Themes.
- It appears there's no indicator if someone's writing. (If you find any theme with indicator feature, be sure to post it.)
Get it working
10.4 Lucid Lynx
( You can also check out this post to get it working.)
- Issue this command
Code:
sudo apt-get install pidgin libnotify-bin libpurple-dev pidgin-dev libwebkit-dev bzr wget
- Use this script
Code:
#!/bin/bash
PAT="~/bin/adium-pidgin"
URL="http://dl.dropbox.com/u/422036/adium-pidgin"
bin="$HOME/bin/"
if [ !-d $bin ]
then
notify-send "Making" \ "bin directory in home folder" --icon=pidgin
mkdir ~/bin
fi
cd $bin
notify-send "I'm in bin" \ "and downloading script, then appling exec rights" --icon=pidgin
wget --no-verbose -O adium-pidgin $URL
chmod +x adium-pidgin
cd ~/
notify-send "Webkit with Karmic's fixes" \ "Downloading, compiling & installing" --icon=pidgin
TMPDIR=`mktemp -d`
cd $TMPDIR
bzr branch lp:~spoidar/pidgin-webkit/karmic-fixes
cd karmic-fixes
make
cp webkit.so ~/.purple/plugins/webkit.so
rm -rf $TMPDIR
notify-send "Now let me make it working" \ "Adding keys to gconf" --icon=pidgin
gconftool-2 -t string -s /desktop/gnome/url-handlers/adiumxtra/command "$PAT %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
notify-send "Check out" \ "Plugins>Webkit message styles and configure it" --icon=pidgin
exit 0
To select theme
Go to
Pidgin > Plugins > Webkit message style > Configure Plugin
Other versions
One Script
to rule two of them
Guess what! Now, Yoda it approves!
Copypasta this text into text editor. If you don't have bin directory in your home folder, make one. Save the file as adium-pidgin there. If you're naughty lad/lass save where ever you wan't but pay attention when you add keys to gconf.
Code:
#!/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
Browsers Support / Handling Adiumxtra
As you can see script is triggered when adiumxtra is used by any browser.
Add gconf keys
Code:
gconftool-2 -t string -s /desktop/gnome/url-handlers/adiumxtra/command "~/bin/adium-pidgin %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
- Firefox
As reported it should work nicely with FireFox 3.5 provided by Karmic. In Jaunty with FireFox 3.0.15, adiumxtra protocol is unrecognized, and I haven't found work around since I rarely use this browser. - Chrome
Latest Chrome gives me no problems. - Opera
To get it working in Opera go to Tools>Preferences>Advanced>Programs and add new
with path to file with script.
Splendid, off we go!
Karmic 10.04
- I'm not sure if provided webkit packages are enough. Add repo just in case
- Issue command to install what needed
- We will need fixed and compiled version off that plugin. Install it and we're off.
Code:
sudo ppa:webkit-team/ppa
sudo apt-get update
sudo apt-get install libnotify-bin pidgin-dev libpurple-dev libwebkit-dev
bzr branch lp:~spoidar/pidgin-webkit/karmic-fixes
cd karmic-fixes
make
cp webkit.so ~/.purple/plugins/webkit.so
Jaunty 9.04
To cook it out we'll need
- libnotify-bin to allow communication feedback from script
- Developer packages for pidgin and libpurple
- Plugin itself from www.nukeador.com
- Repo from webkit-team and webkit-dev package from there
- Script itself
We'll do this like this
Code:
sudo apt-get install libnotify-bin pidgin-dev libpurple-dev
cd
wget -c http://www.nukeador.com/wp-content/uploads/2009/03/pidgin-webkit.tar.bz2
mv plugins ~/.purple/
mv message_styles ~/.purple/
rm -rf LEEME
rm -rf pidgin-webkit.tar.bz2
sudo echo -e "#Webkit-team repo \n deb http://ppa.launchpad.net/webkit-team/ppa/ubuntu jaunty main \n deb-src http://ppa.launchpad.net/webkit-team/ppa/ubuntu jaunty main \n" >> /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2D9A3C5B
sudo apt-get update && sudo apt-get install libwebkit-dev
9.10 and below
I believe you'll need to repeat steps as for Jaunty and compile plugin by yourself. It's not that much of a work. Just some variations of previous commands.
Cheers.
PS. There's some lousy coding in. Suggestions? Go ahead and pm or post it here.
Bookmarks