Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've added Skype to my "Startup applications" list, so that it starts automatically after I log in. (This is on Ubuntu 9.04 Jaunty, with the Gnome desktop)

However, I frequently use my laptop offline, and then Skype is less than useless: it just serves to annoy me with a startup noise and permanently animated toolbar icon.

Is there a way to tell Skype to start only when I'm online? Can I use Upstart to do something like that?

share|improve this question
    
Related: superuser.com/questions/32658/… –  nagul Sep 28 '09 at 15:58
    
Consider adding ubuntu to the tag list. –  Nick Stinemates Sep 28 '09 at 21:01
add comment

3 Answers

Add a script to your bin directory, and start that script instead of starting skype.

The script will look kind of like this:

#!/bin/bash -f
if [[ `ifconfig eth0|grep 'inet addr'` ]] ; then
    skype
fi

It's ghetto but it should work.

share|improve this answer
    
perhaps adding this script to autorun should be helpfull –  bbaja42 Nov 6 '09 at 10:53
    
You can simplify this to if ifconfig eth0|grep -q 'inet addr' Still, perhaps not the best way to check for connectivity. It also hard-codes the interface name. –  Joseph R. Sep 1 '13 at 20:22
add comment

This might be helpful for you . Actually i have asked this question for empathy chat client . I guess u can do for skype also

share|improve this answer
add comment

Try this script. It uses a ping test to determine whether you're online, launches Skype if you are and warns you if you're not:

#!/bin/bash

if ping -c 1 -W 5 google.com &>/dev/null;then
    exec skype
else
    echo "No Internet connectivity. Bailing..."
    exit 1
fi
share|improve this answer
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.