Skip to content

Instantly share code, notes, and snippets.

@flowolf
Last active March 8, 2021 19:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flowolf/b5af11c2dfbf401550fd4b4f2000bcec to your computer and use it in GitHub Desktop.
Save flowolf/b5af11c2dfbf401550fd4b4f2000bcec to your computer and use it in GitHub Desktop.

Synergy between Linux and Mac Os X

sharing a mouse and keyboard between two computers

A quick writeup for a working setup (Linux is Server, Mac is Client)

synergy.conf:

section: screens
    linux:
    mac:

end
section: aliases
    mac:
        mac.local
    linux:
        itchy # linux hostname
end
section: links
    linux:
        right = mac
    mac: 
        left = linux
end
section: options
    switchDelay = 300
    keystroke(control+super+right) = switchInDirection(right) # Switch screens on keypress 
    keystroke(control+super+left) = switchInDirection(left)
end

install for Mac Os X

needs homebrew:

$ brew cask install synergy

In the system preferences, allow SSH (found under sharing)

install on Linux

$ apt install synergy
$ ssh-copy-id -o PubKeyAuthentication=no -i .ssh/id_rsa.pub YOURMAC

Running

Synergy does not encrypt trafic in default setup. Therefore we tunnel the traffic through ssh.

start the client on the mac.

run this script on Linux to start the server:

#!/bin/bash
PORT=24800

ssh -f -R $PORT:127.0.0.1:24800 YOURMAC sleep 10
sleep 1
synergys --config ~/.config/synergy.conf -f -n YOUR_SERVER -d DEBUG --restart 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment