Apr 5, 2011

Add Skype To Messaging Menu

Well everyone know what Skype is, this tutorial will show you how to integrate Skype in Ubuntu Messaging Menu.


Open terminal and start typing:
sudo gedit /usr/share/applications/skype.desktop
paste this at end
StartupNotify=true
Save.
Now,
sudo gedit /usr/share/indicators/messages/applications/skype
and paste this:
/usr/share/applications/skype.desktop
Now is Skype integrated in Messaging Menu, now there is a bug when you click on Skype when is Skype running it will not show Skype but start new one.
To fix this type in terminal.
gedit ~/showskype.py
and paste this:
#!/usr/bin/env python
import dbus
# Get a D-Bus interface to Skype
bus = dbus.SessionBus()
skype_object = bus.get_object('com.Skype.API', '/com/Skype')
skype = dbus.Interface(skype_object, dbus_interface='com.Skype.API')
# Ask for permission to control Skype
response = skype.Invoke("NAME " + __file__)
response = skype.Invoke("PROTOCOL 8")
# Issue commands
response = skype.Invoke("SET WINDOWSTATE NORMAL")
print response
Save and then,
sudo gedit /usr/local/bin/skype
and paste:
#!/bin/bash
nbi=$(pgrep -c skype)
if [ $nbi -ge 2 ];then
~/showskype.py
else
/usr/bin/skype
fi
and at the end:
sudo chmod +x /usr/local/bin/skype
Now restart or logout to take effect.

Skype will ask permission to use the script, check "Remember this selection" and Yes


To get new messages displayed in Messaging Menu you need to download script .

You can use script created by Jonathan Foucher or one by Andy.

I use Andy's script because it works with Skype's nortification, Jonathan didn't work i don't know why...

Andy's script:

You can read all about it on Andy's blog, download script here.

After you downloaded script copy it to home folder or somewhere safe :)
Now start Skype and go to Options > Nortifications

Click on Skype Login and then on Advanced View.
Check Execute the following script and paste:
python /SCRIPT LOCATION/indicator-applet-skype.py
replace SCRIPT LOCATION with location of the script, example:
python /home/ivan/Skype/indicator-applet-skype.py
Now every time Skype starts script will run.

Jonathan script:

You can find all abut script on Jonathan website 

Before downloading script you need to install these dependencies,
sudo apt-get install python-skype python-indicate
Now download script

To use the script just start skype-indicator.py after you have sing in on Skype.
Script will check every 5 second for new messages and calls.


0 comments:

Post a Comment