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.

I'm using Linux for about two years now, but due to my Windows legacy I like keeping shortcuts on my desktop instead of dockies, panel shortcuts, etc.

If Skype is already running, pressing the shortcut starts a new sequence rather than opening an existing one. This is kinda cool as you can have two accounts running. But I only have one.

So, my question is whether it is possible to tweak Skype into opening an already existent instance when pressing the shortcut?

share|improve this question
1  
Never mind, I found the answer at: forum.skype.com/index.php?showtopic=332401 –  Koffeehaus Jun 14 '11 at 22:27
    
Your comment should have been an answer. I took the liberty of doing it for you. –  djeikyb Aug 4 '11 at 4:08

1 Answer 1

up vote 2 down vote accepted

A user, jackwizard, over at the Skype forums found a workaround. His script is mirrored at github, and copied here for your convenience.

  1. Copy it into a file called skype-single-instance
  2. Make it executable. chmod +x skype-single-instance
  3. Test it. pkill -9 skype, then ./skype-single-instance, then ./skype-single-instance
  4. Make it available system-wide. sudo cp skype-single-instance /usr/bin/
  5. Change your shortcuts to use it instead of the normal skype command.

.

#!/usr/bin/env python
import dbus
import sys
import os

try:
    # Try and set skype window to normal
    remote_bus = dbus.SessionBus()
    out_connection = remote_bus.get_object('com.Skype.API', '/com/Skype')
    out_connection.Invoke('NAME mySkypeController')
    out_connection.Invoke('PROTOCOL 5')
    #out_connection.Invoke('SET WINDOWSTATE MAXIMIZED')
    out_connection.Invoke('SET WINDOWSTATE NORMAL')
    out_connection.Invoke('FOCUS')
except:
    os.system("skype")
    sys.exit()
share|improve this answer

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.