Skip to content

Instantly share code, notes, and snippets.

@mallendeo
Last active August 21, 2023 03:32
Show Gist options
  • Select an option

  • Save mallendeo/cb000f05c67356b307d0f78817bf30a2 to your computer and use it in GitHub Desktop.

Select an option

Save mallendeo/cb000f05c67356b307d0f78817bf30a2 to your computer and use it in GitHub Desktop.
Run Synergy / Barrier on Ubuntu 22.04

Run Synergy on Ubuntu 22.04

Disable Wayland since it's not supported

On /etc/gdm3/custom.conf, uncomment WaylandEnable=false

Also, add this line on the [daemon] section:

DefaultSession=gnome-xorg.desktop

you can also choose Xorg on the gear in the GDM login page

Start Synergy on every user account on boot

Copy the contents of the files and edit YOUR_CLIENT_NAME, SERVER_HOST_OR_IP and PORT variables where appropiate.

Start Synergy after GDM loads

nano /usr/share/gdm/greeter/autostart/synergyc.desktop
## /usr/share/gdm/greeter/autostart/synergyc.desktop

[Desktop Entry]
Type=Application
Name=synergyc
Exec=/usr/bin/synergyc --enable-crypto --profile-dir /srv/synergy --name YOUR_CLIENT_NAME SERVER_HOST_OR_IP:PORT
NoDisplay=true
X-GNOME-AutoRestart=true

Kill the GDM Synergy instance once logged in

nano /etc/gdm3/PostLogin/Default
## /etc/gdm3/PostLogin/Default

/usr/bin/killall synergyc
while [ $(pgrep -x synergyc) ]; do sleep 0.1; done
sudo chmod +x /etc/gdm3/PostLogin/Default

Start Synergy on every login for every user account

nano /etc/X11/Xsession.d/85synergyc
## /etc/X11/Xsession.d/85synergyc

/usr/bin/killall synergyc
while [ $(pgrep -x synergyc) ]; do sleep 0.1; done
/usr/bin/synergyc --profile-dir /srv/synergy --enable-crypto --name YOUR_CLIENT_NAME SERVER_HOST_OR_IP:PORT
sudo chmod +x /etc/X11/Xsession.d/85synergyc

Then, copy your ~/.synergy directory with the fingerprint files to /srv/synergy

sudo mkdir /srv/synergy && sudo cp -r ~/.synergy /srv/synergy
/srv
`-- synergy
    `-- SSL
        |-- Fingerprints
        |   |-- Local.txt
        |   `-- TrustedServers.txt
        `-- Synergy.pem

Give it permission so every user and GDM can load the fingerprint and SSL key:

sudo chmod -R 705 /srv/synergy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment