Sharing mouse & keyboard between PC

Share one mouse and keyboard between multiple computers - Barrier (fork of Synergy) / Fast Desktop Switching

Feature

  • clipboard sharing - enable copy/paste between PC
  • screensaver sync
  • Immune keys - keys that Barrier will not forward to other PCs.
  • start as systemd service

Barrier as startup application

Launch directly the ui

/home/yves/app/barrier/barrier

For client config:

  • give server ip
  • unselect auto-config
  • display name can be overriden and shared by several computer

caption

Barrier server as user service (per X11 session) - ** NOT WORKING **

systemctl enable barrier@myuser.service
systemctl start barrier@myuser.service

Copy config below .config/systemd/user/barrier.service

[Unit]
Description=Barrier Client daemon

[Service]
ExecStart=/home/yves/app/barrier/barriers --no-daemon --no-restart --enable-crypto --display :0 --debug NOTE --config ~/.config/barrier.conf
Restart=always

[Install]
WantedBy=multi-user.target

Troubleshoot

if launching twice the application/server you will got this kind of message (which may be confusing), due to port being already used:

Qt: Session management error: Could not open network socket
*** WARNING *** The program 'barrier' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>

Wayland ?

Alternative

Building on Linux

require

$ sudo apt update && sudo apt upgrade
$ sudo apt install git cmake make xorg-dev g++ libcurl4-openssl-dev \
                 libavahi-compat-libdnssd-dev libssl-dev libx11-dev \
                 qtbase5-dev
$ sudo apt install libxtst-dev	# missing from doc

Works perfectly from source version

$ git clone https://github.com/debauchee/barrier.git
# this builds from master,
# you can get release tarballs instead
# if you want to build from a specific tag/release
$ cd barrier
$ git submodule update --init --recursive
$ ./clean_build.sh
$ cd build
$ sudo make install # install to /usr/local/

Packaging as an AppImage - ** NOT COMPLETE **

# build as above, 
# then install into 'AppDir'
$ cd build
$ make install DESTDIR=../AppDir
# test that the application still work from AppDir/xx/bin/yy
# run recipe generation assistant in parent folder containing AppDir
$ appimage-builder --generate
# this generate a AppImageBuilder.yml recipe in parent folder
# then build the AppImage
$ appimage-builder --skip-tests
Written on September 6, 2020, Last update on March 15, 2024
kvm display keyboard