12

This is the first thing I do after logging in:

screenshot

How can I make it happen automatically?

1
  • Same problem / solution on 12.04 LTS for the record.
    – Tim Abell
    May 16, 2013 at 9:32

2 Answers 2

14

To make the default Ubuntu IM application Empathy start automatically when you log in, the following instructions are from OMG Ubuntu:

Empathy requires a little bit of a kick to get going on login.

You would be forgiven for thinking that checking the ‘Automatically connect on start-up’ box in Empathy’s preferences pertained to starting on system login. It doesn’t, the start-up in this case refers to Empathy’s start up – not your computer’s.

We can make it start on login by going to System > preferences > startup applications > new item and entering the following information in the relevant fields:

Name: Empathy

Command: empathy -h

2
  • @fluteflute: Thanks for making the answer for meaningful... :-)
    – Kushal
    May 4, 2011 at 3:20
  • 2
    I still think that's pretty counter intuitive.. am I the only one?
    – levesque
    Apr 9, 2013 at 1:03
5

this script will automatically set status to "unavailable" when screen is locked or screensaver is activated, and will bring it back to available (online) when screensaver is closed!

#!/usr/bin/python

import os
import time
import dbus
session_bus = dbus.SessionBus()
from gi.repository import TelepathyGLib as Tp
from gi.repository import GObject
loop = GObject.MainLoop()
am = Tp.AccountManager.dup()
am.prepare_async(None, lambda *args: loop.quit(), None)
loop.run()

screensaver_started = 0
running = 0

while 1:
    active = 0
 out = ""
 pid = 0

 if screensaver_started == 0:
     # Don't do anything if the screensaver isn't running
     s = os.popen("pidof gnome-screensaver")
     spid = s.read()
     s.close()
     if len(spid) > 0:
         screensaver_started = 1
 else:
     h = os.popen("gnome-screensaver-command -q", "r")
     out = h.read()
     active = out.find("inactive")
     h.close()

     if active < 0 and running == 0:
         am.set_all_requested_presences(Tp.ConnectionPresenceType.OFFLINE, 'Offline', "")
         running = 1
     elif active > 0 and running == 1:
         am.set_all_requested_presences(Tp.ConnectionPresenceType.AVAILABLE, 'available', "")
         running = 0
     time.sleep(3)
1
  • 3
    nice solution but most newbies turn away from Linux when they encounter such a script for such a simple need.
    – Kushal
    May 10, 2012 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .