[GH-ISSUE #1923] barrierc with lightdm and XFCE on Debian HOWTO #1403

Open
opened 2026-05-05 07:48:24 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @JiffB on GitHub (Apr 1, 2023).
Original GitHub issue: https://github.com/debauchee/barrier/issues/1923

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 :

  • Whether you're using this howto or not, you MUST first launch barrier (the full shebang that displays a windows on the destop) from the client (in graphical mode) in order to answer it's question about the server certificate acceptation - accept it of course.
  • Logically, you have accepted the server certificate from an instance of barrier launched by a USER, but it also have to be accepted by ROOT, to do so, as the root user, make a recursive copy : cp -r /home/<username>/.local/share/barrier ~/.local/share/ This way, the server certificate is already accepted by a root instance of barrierc.

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

  • when lighdm starts, it launches barrierc through the greeter-setup-script with root rights,
  • when entering the new XCFE session, the barrierc root version is superseded by the user's,
  • when locking the screen (so returning to lightdm), the old barrierc root version is killed and another one is created that supersedes the user's, which allow to enter credentials in the login popup (impossible with the user's version),
  • when unlocking the screen (so returning to the former XFCE user session), the root barrierc dies opportunely to leave the way to the user's version,
  • and so on.
Originally created by @JiffB on GitHub (Apr 1, 2023). Original GitHub issue: https://github.com/debauchee/barrier/issues/1923 ### 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 : * Whether you're using this howto or not, you MUST first launch barrier (the full shebang that displays a windows on the destop) from the client (in graphical mode) in order to answer it's question about the server certificate acceptation - accept it of course. * Logically, you have accepted the server certificate from an instance of barrier launched by a USER, but it also have to be accepted by ROOT, to do so, as the root user, make a recursive copy : ```cp -r /home/<username>/.local/share/barrier ~/.local/share/``` This way, the server certificate is already accepted by a root instance of barrierc. That's all folks.     For those interested in the proceedings : * when lighdm starts, it launches barrierc through the greeter-setup-script with root rights, * when entering the new XCFE session, the barrierc root version is superseded by the user's, * when locking the screen (so returning to lightdm), the old barrierc root version is killed and another one is created that supersedes the user's, which allow to enter credentials in the login popup (impossible with the user's version), * when unlocking the screen (so returning to the former XFCE user session), the root barrierc dies opportunely to leave the way to the user's version, * and so on.
Author
Owner

@G2G2G2G commented on GitHub (Apr 9, 2023):

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

<!-- gh-comment-id:1501024649 --> @G2G2G2G commented on GitHub (Apr 9, 2023): This project is dead, use https://github.com/input-leap/input-leap a fork of it which is active
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1403
No description provided.