From 1f57b8a88010dd74620381fa16e7af1b3b515960 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sun, 10 Nov 2024 05:53:42 +0100 Subject: [PATCH] x window system: troubleshooting for file picker --- wiki/linux/systemd.md | 4 +++- wiki/linux/x_window_system.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/wiki/linux/systemd.md b/wiki/linux/systemd.md index fa3b037..9ec857c 100644 --- a/wiki/linux/systemd.md +++ b/wiki/linux/systemd.md @@ -43,7 +43,7 @@ Alternatively it can be enabled to start at every boot by running: sudo systemctl enable unturned ``` -### Start/Stop/Enable/Disable a service +### Start/Stop/Enable/Disable a service and Retrieve its Logs Services can be started by running `systemctl start `. They respectively can be stopped by replacing the `start` @@ -52,6 +52,8 @@ To start the service after boot it has to be enabled. This works accordingly with the keyword `enable`. The `disable` keyword stops the service from starting automatically. +Logs of the last start of the service can be found by running `systemctl status `. + ### Retrieving the SystemD Logs SystemD logs can easily be found using the `journalctl` command. diff --git a/wiki/linux/x_window_system.md b/wiki/linux/x_window_system.md index c160d49..7355dd7 100644 --- a/wiki/linux/x_window_system.md +++ b/wiki/linux/x_window_system.md @@ -151,3 +151,34 @@ This usually means that either the [Nvidia](/wiki/nvidia.md) kernel module is no This can be fixed by [installing Nvidia](/wiki/linux/nvidia.md#setup). If this is not the problem then the [initial ramdisk](/wiki/linux/mkinitcpio.md) should be [regenerated](/wiki/linux/mkinitcpio.md#manually-generate-initial-ramdisk). + +### File Picker Doesn't Work + +If the file picker doesn't work in applications like [Discord](/wiki/discord.md) for example first +check if the desktop portal is installed. +For that search for the package `xdg-desktop-portal` or a similar named one using your +[package manager](/wiki/linux/package_manager.md). +If it is installed check if it starts up correctly by using the command +`systemctl --user status xdg-desktop-portal` as described in the +[SystemD entry](/wiki/linux/systemd.md#startstopenabledisable-a-service-and-retrieve-its-logs). + +A possible error is `cannot open display`. +To fix this you can run the following commands to temporarily make the file picker work. + +```sh +systemctl --user import-environment DISPLAY XAUTHORITY +systemctl --user restart xdg-desktop-portal +``` + +If that works make sure the Xorg configs are sourced for users aswell. +It is possible that the following code block is missing in the local `.xinitrc`. +This would create similar errors to the ones experienced. + +```sh +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi +```