Project D

Synergy - One ‘Mouse’ for All, All for One ‘Keyboard’

Some times its very inconvenient to control multiple computer lurking in your desktop by using multiple mouse and keyboard.

Sure you can use ssh or telnet session to control them, but TEXT ONLY Session? Hell you can use VNC server man!. but but but…. how about one keyboard plus one mouse for them all?.

This is where synergy comes into play, Image four computer controlled with one keyboard plus one mouse?.

Interested? here’s how you do it.

First of all you have to read : http://synergy2.sourceforge.net/ for more informations and download.

Then in my scenario is this :

Computer = 4 units
Computer OS = 2 Gentoo box, 1 Vista box and 1 XP box

My command center is a gentoo laptop

-= Gentoo Laptop command center =-

I need to emerge x11-misc/synergy first

then edit /etc/synergy.conf

# sample synergy configuration file
#
# comments begin with the # character and continue to the end of
# line.  comments may appear anywhere the syntax permits.
# Reminder hostname are case sensitive
 section: screens
       # three hosts named:  moe, larry, and curly
       localhost: # your freevo box hostname
       Toshiba:  # your controlling box hostname
 #       curly: # extra box
 end
 section: links
       # larry is to the right of moe and curly is above moe
       Toshiba: # your controlling box hostname

 #               right = larry
                 up    = localhost # your freevo box hostname
 #
       # moe is to the left of larry and curly is above larry.
       # note that curly is above both moe and larry and moe
       # and larry have a symmetric connection (they're in
       # opposite directions of each other).
       localhost: # your freevo box hostname
               down  = Toshiba # your controlling box hostname
 #               up    = curly
       # larry is below curly.  if you move up from moe and then
       # down, you'll end up on larry.
 #       curly:
 #               down  = larry
 end
 section: aliases
       # curly is also known as shemp
       localhost:
               freevobox
 end

Create synergy checker script

 #!/bin/bash
 SERVICE="synergys"
 SERVICERUN="synergys"
 PATHSERV="/usr/bin"
 sleep 1
 if ps ax | grep -v grep | grep $SERVICE &> /dev/null
 then
   echo "$SERVICE service running, killing it"
   echo "Killing $SERVICE"
   killall $SERVICE
   killall sleep
 $PATHSERV/$SERVICERUN
   else
   echo "$SERVICE is not running"
   echo "Running new $SERViCE"
 $PATHSERV/$SERVICERUN"
 fi
 exit 0

Make the script executable by

chmod +x SCRIPT 

add it to crontab by

crontab -u USER SCRIPT

Run the script

-=Gentoo Slave Box=-
Install Synergy by

emerge x11-misc/synergy

You dont need to edit /etc/synergy.conf

create launcher script

 #!/bin/bash
 SERVICE="synergyc"
 SERVICERUN="synergyc PUT-YOUR-CONTROLLING_LAPTOP-IP-NUMBER-HERE"
 PATHSERV="/usr/bin"
 sleep 1
 if ps ax | grep -v grep | grep $SERVICE > /dev/null
 then
 echo "$SERVICE service running, killing it"
 echo "Killing $SERVICE"
 killall $SERVICE
 killall sleep
 $PATHSERV/$SERVICERUN"
 else
 echo "$SERVICE is not running"
 echo "Running new $SERVICE"
 $PATHSERV/$SERVICERUN"
 fi
 exit 0

Make it executable by chmod +x SCRIPT
run the script

Create the crontab checker script

 #!/bin/bash
 SERVICE="synergyc"
 SERVICERUN="synergyc YOUR-CONTROLLING-BOX-IP-NUMBER"
 PATHSERV="/usr/bin"
 sleep 1
 if ps ax | grep -v grep | grep $SERVICE > /dev/null
 then
 echo "$SERVICE service running, Good... leaving it alone"
 exit 0
 else
 echo "$SERVICE is not running"
 echo "Running new $SERVICE"
 $PATHSERV/$SERVICERUN"
 fi
 exit 0

Make the script executable and add it into crontab.

-=Windows Box Vista and XP=-

No informations…. sorry linux only.

-=end transmission=-

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • blinkbits
  • eKudos
  • Live
  • Share/Save/Bookmark

RSS Fresh Ebuild