- Arch Linux
- Xcode
- Mac Ports
- Synergy
- Install the required libraries.
sudo port install cmake
sudo port install qt5
- Add the path of the libraries.
PATH=/opt/local/libexec/qt5/bin:$PATH
- Get the Synergy source code.
git clone https://github.com/synergy/synergy.git
cd synergy/src/gui/src
nano CommandProcess.h
- Take note of the path of the active developer directory.
/Applications/Xcode.app/Contents/Developer
- Fix the toolchain to handle the OS X version.
nano ext/toolchain/commands1.py
def getMacSdkDir(self):
# return "/Developer/SDKs/" + sdkDirName + ".sdk"
return "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/" + sdkDirName + ".sdk"
# ./hm.sh setup
./hm.sh genlist
- Check for the supported compilers.
1: Unix Makefiles
2: Xcode
3: Eclipse CDT4 - Unix Makefiles
- Compile the sources, specifying the OS X version.
./hm.sh conf -g2 --mac-sdk 10.11
./hm.sh build
- Check for a successful build.
Entering dir: build
=== BUILD AGGREGATE TARGET ZERO_CHECK OF PROJECT synergy WITH CONFIGURATION Release ===
Check dependencies
...
Build all projects
** BUILD SUCCEEDED **
...
Make GUI command: make -w
Entering dir: src/gui
...
Copying plugins dirtree: bin/Release/plugins
Copying to: bin/Release/Synergy.app/Contents/MacOS/plugins
Entering dir: bin/Release
...
bin/Release/Synergy.app
- Copy the Client program into one of the binaries paths.
sudo cp -v bin/Release/synergyc /opt/local/bin/
- Copy the Server program (if you want OS X to act as)
sudo cp -v bin/Release/synergys /opt/local/bin/
- Follow these instructions to install the Synergy server from the Arch Linux Repository.
- Configure the computers disposal.
sudo nano /etc/synergy.conf
section: screens
client-host-name:
altgr = alt
server-host-name:
end
section: links
client-host-name:
right = server-host-name
server-host-name:
left = client-host-name
end
section: aliases
client-host-name:
client-host-name.some-domain
end
synergyc -f server-host-name
- Configure a plist file to auto start the Synergy client whenever the user starts a session.
nano ~/Library/LaunchAgents/com.domain.synergy.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.domain.synergy</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/synergyc</string>
<string>-f</string>
<string>-d</string>
<string>WARNING</string>
<string>server-host-name</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
launchctl load ~/Library/LaunchAgents/com.domain.synergy.plist
systemctl enable synergys@<username>.socket # replace with the unix user name
- Failed : The Synergy server is terminated with a core dump because the
<username>
must be allowed to make connections to the X server.
xhost +local:<username>
sudo -u <username> synergys --daemon
- Partly successful : until the mouse leaves the master screen to enter the slave screen. Might be due by the fact that XDM grabs the X keyboard.
#!/bin/sh
pidof synergys
declare -i STATE=$?
if (( $STATE == 1 )); then
xhost +local:${USER} > /dev/null 2>&1
declare -i RC=$?
if (( $RC == 0 )); then
sudo -u ${USER} synergys -d WARNING --daemon
fi
fi
#!/bin/sh
killall synergys > /dev/null 2>&1
- Successful : this solution allows an early startup of the Synergy server, right before the user starts a X session, and die when the X session stops. However, it won't let the Synergy server run during the XDM chooser.
- An Arch Linux package is available in the AUR