nextcloud: fix GTK module warning, Qt session error, skip KWallet on non-KDE

cinnamon_fullsetup.cfg: add xapps package so the xapp-gtk3-module GTK
module referenced in Cinnamon's GTK settings is present for Flatpak apps.

user_run.sh: pass --setenv=SESSION_MANAGER= to systemd-run so Qt does not
try to connect to an X11 session manager socket that may not exist (fixes
"Could not open network socket" on Wayland and non-KDE desktops).
Guard the KWallet D-Bus block behind a session-bus presence check
(qdbus | grep org.kde.kwalletd) so it is skipped entirely on Cinnamon and
other non-KDE desktops instead of producing D-Bus errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel unbrot Pätzold
2026-05-03 20:56:34 +02:00
parent 73de38efe6
commit b214880351
2 changed files with 25 additions and 18 deletions
@@ -102,6 +102,9 @@ for i in {0..99}; do
NC_WALLET_APPID="logon_script" NC_WALLET_APPID="logon_script"
NC_QB_CMD="qdbus-qt6" NC_QB_CMD="qdbus-qt6"
if ! command -v ${NC_QB_CMD} >/dev/null 2>&1; then NC_QB_CMD="qdbus"; fi if ! command -v ${NC_QB_CMD} >/dev/null 2>&1; then NC_QB_CMD="qdbus"; fi
# Only attempt KWallet on KDE: check that the service is registered on the session bus.
if command -v "${NC_QB_CMD}" >/dev/null 2>&1 && \
"${NC_QB_CMD}" 2>/dev/null | grep -q "org.kde.kwalletd"; then
NC_QB_SVC="org.kde.kwalletd" NC_QB_SVC="org.kde.kwalletd"
NC_QB_PATH="/modules/kwalletd6" NC_QB_PATH="/modules/kwalletd6"
if ! ( ${NC_QB_CMD} "${NC_QB_SVC}" | grep -q "${NC_QB_PATH}" ); then if ! ( ${NC_QB_CMD} "${NC_QB_SVC}" | grep -q "${NC_QB_PATH}" ); then
@@ -122,6 +125,9 @@ for i in {0..99}; do
else else
echo "Warning: Could not open KWallet (handle: ${NC_WALLET_HANDLE}). Nextcloud may prompt for credentials on next start." echo "Warning: Could not open KWallet (handle: ${NC_WALLET_HANDLE}). Nextcloud may prompt for credentials on next start."
fi fi
else
echo "KWallet not available (non-KDE desktop) — skipping credential storage."
fi
fi fi
done done
@@ -151,7 +157,7 @@ done
#fi #fi
# Now start Nextcloud # Now start Nextcloud
echo "Starting Nextcloud Client in Background" echo "Starting Nextcloud Client in Background"
systemd-run --user --no-block --unit=nextcloud-client.service ${BASECMD} >>${TEMPDIR}/nc_desktop_client.log 2>&1 systemd-run --user --no-block --unit=nextcloud-client.service --setenv=SESSION_MANAGER= ${BASECMD} >>${TEMPDIR}/nc_desktop_client.log 2>&1
sleep 2 sleep 2
echo "Done Setup of Nextcloud." echo "Done Setup of Nextcloud."
exit 0 exit 0
+1
View File
@@ -63,6 +63,7 @@ flatpak
btrfs-assistant btrfs-assistant
btrbk btrbk
transmission-gtk transmission-gtk
xapps
cadaver cadaver
git git
diffuse diffuse