Noteworthy

  • Synergy

    Posted May 22nd, 2009 in Noteworthy With | 2 Comments

    Synergy

    The Setup

    I have one desktop computer running Ubuntu Linux connected to a wall mounted screen. I also have a 15″ Unibody MacBook Pro connected to a 24″ Apple Led Cinema Display.

    The Problem

    All this hardware creates a clutter on my desk requiring me to have more than one set of keyboard and mouse. It also makes it difficult to work on both computers at the same time.

    The Solution

    A small piece of software called Synergy. This piece of software gives me the ability to share my keyboard and mouse connected to one of the computers via the network interfaces, either being wireless or wired.

    Synergy works with almost any setup and any operating system that being either windows, macintosh or linux. And the best part is that the client computers do not have to have a keyboard or mouse connected to them.

    Synergy give me the ability to control 2 or more computers (windows, mac, linux) with the keyboard and mouse of only one of them. This means that the wall mounted computer doesn’t need to have any keyboard or mouse. For my problem this was the perfect solution.

    Not having a keyboard for said computer in the long run presented some other problems. Like I could not restart the machine, or logout or switch users. Since when I did any of the previously mentioned actions it resulted in Synergy loosing connection and me needing to plug in a keyboard to make everything work again.

    Thus a solution was needed to be created.

    I’ve altered my login scripts to start Synergy so it will connect to the sever automatically. Bellow you will find what files I’ve either edited or created in order to make this work.

    File: /etc/gdm/init/default
    and File: /etc/gdm/PreSession/default

    /etc/init.d/synergy stop
    /etc/init.d/synergy start
    

    File: /etc/init.d/synergy

    #!/bin/sh
    # Start synergy to connect to server pc2
    
    case "$1" in
    'start')
        synergyc pc2
        ;;
    'stop')
        killall synergyc sleep 1
        ;;
    'status')
        ps auwxx | grep synergyc
        ;;
    *)
        echo "Usage: $0 { start | stop | status }"
        ;;
    esac
    exit 0
    

    Also for the above file the following command need to be executed.

    chmod +x /etc/init.d/synergy
    

    For the configuration file of Synergy itself here is a sample but this depends on your setup. Remember that the opposite of this configuration file must exist on the server otherwise you won’t be able to move your mouse back to it.

    File: /etc/synergy/synergy.conf

    section: screens
            pc1:
            pc2:
    end
    section: links
            pc1:
                    right = pc2
            pc2:
                    left = pc1
    end
    
    Tags: , ,

Constantinos Koloumrbis 2004-2013 ©