debauchee / barrier

Open-source KVM software
Other
27.17k stars 1.5k forks source link

barrierc with lightdm and XFCE on Debian HOWTO #1923

Open JiffB opened 1 year ago

JiffB commented 1 year ago

What happened?

it took me a while to figure out how to do this correctly, so this is just a return :)

Version

v2.4.0

Git commit hash (if applicable)

No response

If applicable, where did you install Barrier from?

Debian bullseye backport package.

What OSes are you seeing the problem on? (Check all that apply)

Linux

What OS versions are you using?

debian bullseye

Relevant log output

No response

Any other information

OS : Debian bullseye + backports Barrier : Version 2.4.0 from backports

Hi,

To avoid using barrierc in root and to be able to lock your screen, it takes a little knowledge and one or two tricks.

First, more than one instance of barrierc can co-exist in memory, however, it is always the last launch that have the hand, second, the one launched at lightdm start doesn't die when entering a user session ON THE FIRST LOGIN, however, it hopefully dies when unlocking the screen.

This is the script (/usr/share/dispsetup.sh, already supplied empty, as I found it just after install) that does the trick :

#!/bin/sh

ROOT_BARRIERC_PID=$(pgrep -u root -x barrierc)
kill -9 $ROOT_BARRIERC_PID > /dev/null

barrierc --debug ERROR 192.168.137.33

IMPORTANT (expecially if the client is using a SSD) : barriec versions before 2.4.0 used to spit a frigging bunch of lines into either /var/log/message and /var/log/syslog, 2.4.0 fortunately ended that. So, for such a talkative version, there's another trick, add : --log /var/log/myfoot (which of course shouldn't exist), barriec won't create it and wont find it, so there will be no inopportune logs.

Into /etc/lightdm/lightdm.conf, in the [Seat:*] section, uncomment the greeter-setup-script=/usr/share/dispsetup.sh line or create it.

For each user (so, if it is a fresh install, you'd better add a path and file into /etc/skel), create an autostart file that'll launch barrierc as follow :

mcedit ~/.config/autostart/BARRIEC.desktop

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Name=Barrier client as a user
Comment=Launches barrierc.
Exec=barrierc --debug ERROR 192.168.137.33
Terminal=false
Type=Application
Hidden=true

Oops, I forgot these 2 important steps :

That's all folks.     For those interested in the proceedings :

G2G2G2G commented 1 year ago

This project is dead, use https://github.com/input-leap/input-leap a fork of it which is active