Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration broken when running under flatpak (XDG_CONFIG_HOME not respected) #80

Open
jeckersb opened this issue Nov 22, 2024 · 0 comments

Comments

@jeckersb
Copy link

I am running the lingot flatpak from flathub on Fedora Silverblue. Each time I start the app, I need to go into the preferences and reconfigure the capture settings. This is because the flatpak environment does not map the user home directory in by default. Instead it only exposes $HOME/.var and then sets XDG_CONFIG_HOME=/var/home/jeckersb/.var/app/org.nongnu.lingot/config. However, lingot does not respect XDG_CONFIG_HOME and always uses $HOME/.config. Because of this, lingot can neither read the config file I place under XDG_CONFIG_HOME, nor can it write to the default location because $HOME/.config does not exist. So each invocation of the app is as if the app has never been run before.

$ flatpak run --command=sh org.nongnu.lingot
[📦 org.nongnu.lingot ~]$ echo $XDG_CONFIG_HOME
/var/home/jeckersb/.var/app/org.nongnu.lingot/config
[📦 org.nongnu.lingot ~]$ ls -al
total 0
drwxr-xr-x. 4 jeckersb jeckersb 80 Nov 22 09:21 .
drwxr-xr-x. 3 jeckersb jeckersb 60 Nov 22 09:21 ..
drwxr-xr-x. 3 jeckersb jeckersb 60 Nov 22 09:21 .local
drwxr-xr-x. 3 jeckersb jeckersb 60 Nov 22 09:21 .var
[📦 org.nongnu.lingot ~]$ lingot
Creating directory /var/home/jeckersb/.config/lingot// ...
Cannot create config folder '/var/home/jeckersb/.config/lingot//': No such file or directory
Creating file /var/home/jeckersb/.config/lingot/lingot.conf ...
error saving config file
Ok
error reading config fileerror opening config file /var/home/jeckersb/.config/lingot/lingot.conf, assuming default values : No such file or directory
cannot read UI settings fileerror saving config file

If XDG_CONFIG_HOME is set, then the config path should prefer that, otherwise it should fall back to $HOME/.config. (https://specifications.freedesktop.org/basedir-spec/latest/#variables)

If I get time I'll put together a PR for this, but for now just wanted to document it before I forget 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant