Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I can make Empathy log me in on boot, but how do I make my initial status Busy?

share|improve this question
add comment

6 Answers

up vote 11 down vote accepted

After some searching, I found an app that communicates with Empathy via dbus. I pulled some code from that and created a script that will set your status.


Setting it up is pretty easy:

Download the script here (github page).

It requires some python libraries that are in the repos (and might be installed by default):

sudo apt-get install python-dbus python-notify

Then to set it to start on login, run Startup Applications, click Add, and fill in the fields like this:

  • Name: Custom -- Start Empathy Busy
  • Command: /usr/bin/python /path/to/empathy_set_status.py dnd
  • Comment: Start empathy and set status to busy (do no disturb).

The command field includes what status to set. If you don't want busy (dnd), then you can use one of these values: available, dnd, away, xa, hidden, offline.

Now when you log in, the script it should run empathy, wait a bit, and then set your status. You should see a notification when it tries to set your status.

I don't check that the status is set correctly, so I just have a wait time to hope that empathy will be ready to let us change the status. Adjust your time if it's not working. Increase the value of EMPATHY_STARTUP_SECONDS until it works when you login. If you need to enter a password to unlock your keychain for your IM login, the delay will have to be long enough for Empathy to start up, for you to enter your password, and for Empathy to log into your accounts.

share|improve this answer
    
This doesn't seem to work anymore (Ubuntu 13.04). It sets the status specified, but then you cannot open the Empathy (contact list) window when you click on it in the Messaging Menu. –  Sadi Aug 21 '13 at 8:14
add comment

There is a bug about the inability to use something other than 'available' as the default status in Empathy. However, if you're willing to consider a different program, Pidgin does let you set a different initial status.

share|improve this answer
add comment

Empathy does not allow this directly. However, you could try the following.

In summary, you can record the mouse motion events where you would normally click the Me Menu and choose the "Busy" status. Alternatively you can navigate to the same Me Menu entry via the Keyboard shortcut F10 and the arrow keys. You could then replay these events on logon through a Start Up Application entry.

This can be down through an application called "cnee". However, the version in Maverick & Natty does not work. If you compile from source, it does work though.

Download the latest source code from here.

cd ~/Downloads
tar -xvf xnee-cvs-20110508.tar.gz
cd xnee-cvs-20110508
sudo apt-get install build-essential
./configure --disable-gnome-applet --disable-gui
make
sudo make install

If configure complains about a missing library/or libraries, install the library reported to be missing:

sudo apt-get install lib<name of library>-dev

Then record the mouse events by running the following (after the count-down) and moving your mouse to the Me Menu and clicking the Busy status, followed by the 'h' keyboard key to stop recording

cnee --record -o ~/changebusy.xnr --mouse --time 5 --stop-key h

Alternatively record keyboard events by choosing the keyboard short cut F10 + LEFT ARROW + LEFT ARROW + DOWN ARROW (twice) + ENTER + h

cnee --record -o ~/changebusy.xnr --keyboard --time 5 --stop-key h

Create a Startup Application with the command

sh -c "sleep 10 && cnee --replay -f ~/changebusy.xnr"
share|improve this answer
    
Great idea! Although I found out that Empathy responds to dbus commands from this blog! –  pydave May 9 '11 at 22:56
add comment

Note that this won't work for irc accounts(maybe others?). Put a try/except block at the end of the script to fix this:

        try:
            simple_presence.SetPresence(status, _STATUSES.get(status))
        except dbus.exceptions.DBusException:
            print(status + ' is not supported by ' + valid_account)
share|improve this answer
add comment

Use Pidgin. Tools > Prefferences > Status/Idle > check the "use status from last exit at startup". Empathy doesn't support the thing you're trying to do, sorry.

share|improve this answer
add comment

Try pidgin.

Please see the below link

http://ubuntuforums.org/showthread.php?p=9241006

share|improve this answer
    
Duplicate answer, but snevs explained how to set it up. (That thread just says "Use pidgin".) –  pydave Oct 3 '11 at 16:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.