29 Jun 2009

How I use Gajim for Google Talk

Edit: If Gajim doesn't connect to Google Talk, check if you're using talk.google.com:5223 as the host and port to connect to.  Here's a screenshot of the configuration window for reference.  (Click on the image to see a larger version.)

Original post:
Several times in the past I have tried to use a native IM client like Pidgin or Psi or Gajim for Google Talk (since there is no Linux version of official Google Talk client).  I tried about half a dozen different clients and liked Gajim the most.  However, there was something that stopped me from using it as my Google Talk client.

You might have noticed that if you change your status message from Google Talk (stand-alone application), your chat status in Gmail will be automatically updated to whatever your new status on Google Talk is.  And vice versa: change your status in Gmail and your status in Google Talk changes too.  This is a cool feature that's been implemented by Google Talk.  But XMMP, the protocol used by Google Talk allows users to use different status messages on different chat clients simultaneously.  Third party chat clients will not copy your status message from Gmail (or vice versa).

So what would happen if I am logged into Gajim and Gmail Chat simultaneously?  My friends would see the status message I set in Gajim and Gmail randomly* at different times.  Because of this I didn't use Gajim, although I disliked the slowness of Firefox.  Recently I found out how to use Gajim and "hide" the status message I set in Gajim from my friends.

Here's how I did it: In Gajim's account configuration settings dialog, I unchecked "Adjust to status" checkbox and specified a low priority.  I used priority 5; but any number less than 10 would do, I guess.  (When this checkbox is checked, Gajim sets the priority to 50 when I'm actively using the compuer, while Google Talk and Gmail sets the priority to 24).  My friends' IM clients, including Google Talk, would use the status from the client that has the highest priority.  Using a low priority ensures that my friends see the status message I set in Gmail.

But when Gmail chat goes "idle", it sets the client priority to 0.  That means my status specified in Gajim takes precedence since its priority is set to 5.  To prevent this, I always choose "Not Available" as my status in Gajim.  This way, when I go idle on Gmail, my friends still see the status message I set in Gmail.

PS: It might be possible that changing the priority is not required at all; but this is how I have set up my account.

* This is not really random; but I don't feel like going into the details.  If you read the whole post there's a pretty good chance that you will understand the "randomness" too.


  1. Ok, I do not know what "randomness" you are talking about even after reading your whole post 5 times. Because it always boggles my mind why you have to go do all the setup you outlined when you do not want to communicate via Gajim.

    Your whole post is shouting "I do not want my friends to communicate with me via Gajim" then do not login Gajim, use Gmail.

    Care to explain what you have in mind more clearly? Why you want to be online in Gajim when you do not want your friends to contact you via Gajim?

  2. Okay, let me explain the "randomness" first. Let's say I log into chat from Gmail and set my status to "google client". This status message will be propagated among all Google clients, so my Android phone picks it up too.

    Then I open Gajim and log in. It retains the status message that I had set in the previous day (let's say it was "feeling sleepy"). Since Gajim's default priority is 50, all my contacts would see my status message as "feeling sleepy".

    I am away from my computer, and so Gmail and Gajim both go idle; but Google Talk client on my Android phone is not idle. My contacts now see "google client" as my status message. I'm back on my computer and the status message is "feeling sleepy" again. For me, having one status message everywhere is important. Setting my status to "Not Available" on Gajim seems to help.

    Besides, the point of the whole post is not to complain: it is to show how I personally use Gajim. Maybe there are people who have the same needs as I do, and they might find this post useful. In my opinion, Gajim is the best XMPP client available on Linux.

  3. nice article, keep the posts coming

  4. Hi,

    Although I am using host as talk.google.com and port as 5223 or 5222, it says Insecure connection alert and does not connect to gtalk. Please advice.