Friday, July 20, 2012

Fixing skype

I use Ubuntu but I use cairo-dock and gnome-session.
 One issue has been that skype doesn't leave any way to bring itself back up if you click the "x" after launching it. It should leave an icon in the system tray but doesn't.

So I found a script that when relaunching skype instead of starting a second instance simply raises the existing instance. Simply replace the regular skype launcher with this.

#!/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 single-instance')
    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()

Wednesday, July 11, 2012

Find recently modified files

Something new I just learned. When using find, -mmin -N will find only files modified in the last N minutes.

~$ find . -type f -mmin -30
Will find only files (-type f) modified in the last 30 minutes.