Barrier: Confusion about default barrier.conf on Arch Linux

Created on 18 Jan 2019  路  7Comments  路  Source: debauchee/barrier

Operating Systems

Server: Arch Linux
Client: Arch Linux

Barrier Version

2.2.0

Steps to reproduce bug

On both of my systems, if I try to start the server, without explicitly specifying a path to the configuration file, it fails with barriers: no configuration available. The man page clearly says:

If no configuration file pathname is provided then the first of the following to load successfully sets the configuration:
$HOME/.local/share/barrier/barrier.conf /etc/barrier.conf

The user-specific file exists. The latter one (system-wide) does not, but that does not really matter.
In fact, everything passes fine if I copy that configuration file path from the manual page and start the server with barriers -c $HOME/.local/share/barrier/barrier.conf.

Investigating further, I've started barriers with -d DEBUG2 option. Here's a partial output:

...opening configuration "/home/user/.local/share/barrier/.barrier.conf"
...cannot open configuration "/home/user/.local/share/barrier/.barrier.conf"

It is looking in the right directory, but for a hidden .barrier.conf file?
What do you think, is this a bad documentation or a wrong path?
Once I've made the file hidden, barriers has been initialized normally, but I do not think that it makes any sense to keep a hidden file inside a hidden directory. Imagine all your dotfiles in $HOME/.config being nested inside other hidden directories.

By the way, it seems like my synergys version prefers $HOME/.synergy.conf as a user-specific configuration file (or at least that's what their manual page says), but in my opinion it's better if we follow the XDG specifications.

bug

Most helpful comment

fwiw barriers --help lists the correct location for Ubuntu (~/.local/share/barrier/.barrier.conf, note it is .barrier.conf). However the man page lists barrier.conf.

$ barriers --version
barriers 2.2.0-Release
Protocol version 1.6

It kinda makes sense, because the SSL files are in that folder. But the .barrier vs barrier thing is strange to me.

All 7 comments

I'm not 100%, but I think we look in $xdg_config_home, which should be ~/.config/barrier. Maybe the manpages haven't been updated to reflect this?

fwiw barriers --help lists the correct location for Ubuntu (~/.local/share/barrier/.barrier.conf, note it is .barrier.conf). However the man page lists barrier.conf.

$ barriers --version
barriers 2.2.0-Release
Protocol version 1.6

It kinda makes sense, because the SSL files are in that folder. But the .barrier vs barrier thing is strange to me.

Hrmm, I wonder if this was a typo made when I had barrier switch over to XDG spec.

Looking at the commit, I don't right off see a reason that the file should be hidden? I'll try to look into it later. 642eb334462f9d0433f9f7028c8b054c22dffe1a

```alex@cooper:~$ barrier.barriers -d DEBUG2 -a 10.233.30.71
[2019-11-19T08:46:50] DEBUG: opening configuration "/home/alex/snap/barrier/83/.local/share/barrier/.barrier.conf"
[2019-11-19T08:46:50] DEBUG: cannot open configuration "/home/alex/snap/barrier/83/.local/share/barrier/.barrier.conf"
[2019-11-19T08:46:50] DEBUG: opening configuration "/etc/barrier.conf"
[2019-11-19T08:46:50] DEBUG: cannot open configuration "/etc/barrier.conf"
barriers: no configuration available
alex@cooper:~$ cat /etc/barrier.conf

Conf file lol

#

section: screens
cooper:
peregrine:
end

section: links

peregrine:
    right = cooper

cooper:
    left = peregrine

end

I think @AdrianKoshka is right; the config file should live in $XDG_CONFIG_HOME since this is explicitly a user defined configuration file, not $XDG_DATA_HOME for application data.

@expl0ratory What are the permissions on those files and what user is the barriers process running under?

[2019-11-19T08:46:50] DEBUG: cannot open configuration "/etc/barrier.conf"

Also is this installed with snap? It may not have access to the real /etc or be looking in the actual $HOME directory if it is.

You might try installing from AUR with barrier or barrier-git and see if you still have the issue.

Was this page helpful?
0 / 5 - 0 ratings