techWebsite/content/posts/autologinNextcloudClientOnArch.adoc

36 lines
2.1 KiB
Plaintext

+++
title = "Getting the Nextcloud client to save login info on arch linux (or any barebones linux distro)"
date = 2021-12-12T14:59:31-05:00
draft = false
+++
:caution-caption: pass:[<span style="font-size: 2em">☠</span>]
:important-caption: pass:[<span style="font-size: 2em">❗</span>]
:note-caption: pass:[<span style="font-size: 2em">✏️</span>]
:tip-caption: pass:[<span style="font-size: 2em">💡</span>]
:warning-caption: pass:[<span style="font-size: 2em">⚠</span>]
:toc:
:toclevels: 6
During the 5 or so years Ive had nextcloud, Ive always been quite happy with the webclient, but the device clients... need some work.
I recently figured out how to resolve one of my biggest pain points on the Linux desktop client, and am recording it here, mostly so I dont forget next time I setup a new computer,
and to save others with the same problem from endless forum post and GitHub issue crawling.
== The cause
Nextcloud expects the environment it is running in to have a 'keychain manager' installed and accessible by libsecret.
However, currently, the Arch Linx nextcloud package does not list libsecret nor any keychain manager as a dependency.
This does not cause a problem if you are using a desktop environment, as they will come with one in their own dependency cloud, but if you are just using a window manager, you may very well not have one installed.
(as a side note, this also seems to cause a significant delay in the client starting up, probably some sort of timeout waiting to access the keyring
== The solution
The solution is... surprisingly simple. You just need to install the `+gnome-keyring+` and `+libsecret+` packages, and set them up to autostart. In order to autostart them properly, adding these 2 lines to your `+.xinitrc+` is enough.
{{<highlight bash "linenos=false">}}
#get gnome-keyring running
dbus-update-activation-environment --all
gnome-keyring-daemon --start --components=secrets
{{</highlight>}}
(yes, you do need `+dbus-update-activiation-environment+`, as `+gnome-keyring+` seemingly relies on certain environment variables to start properly.)