Artix Linux Forum

Artix Linux => Software development => Topic started by: capezotte on 20 March 2021, 00:03:42

Title: [DONE] [Request] Wrap KDE Plasma X11 with `plasma-dbus-run-session-if-needed`
Post by: capezotte on 20 March 2021, 00:03:42
Currently, the beginning of /usr/share/xsessions/plasma.desktop are:

Code: [Select]
[Desktop Entry]
Type=XSession
Exec=/usr/bin/startplasma-x11
TryExec=/usr/bin/startplasma-x11

This causes some subtle issues:

1. GTK applications launched through global shortcuts can't access DBus (for example, Chromium is unable to launch the file manager if one clicks "Show download folder"). Qt apps seem unnaffected, though.
2. Both GTK and Qt applications launched through KRunner will have D-Bus access, but will have the / (root) as working directory (for example, launch Konsole through a global shortcut, PWD is ~; launch through KRunner, PWD is /)
3. Comparing the output of `export` ran on a Konsole launched through global shortcuts, and on a Konsole launched through KRunner, one notices the variable `DBUS_SESSION_BUS_ADDRESS` is missing on the first (presumably causing issue #1).

Once we change the Exec line of /usr/share/xsessions/plasma.desktop to

Code: [Select]
Exec=/usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-x11

These issues go away (global shortcut GTK apps work as expected, KRunner applications have ~ as workdir). Plasma Wayland is already wrapped with `plasma-dbus-run-session-if-needed`, and doesn't have these specific issues. I haven't tested KDE Openbox, though.

EDIT: KDE/Openbox has the same issue, but can fixed in the same way (wrap with `/usr/lib/plasma-dbus-run-session-if-needed`)

Would the package maintainers mind making this change to the plasma-workspace package?
Title: Re: [Request] Wrap KDE Plasma X11 with `plasma-dbus-run-session-if-needed` (too)
Post by: Dudemanguy on 20 March 2021, 02:59:56
I thought .desktop files were upstream from the source code.
Title: Re: [Request] Wrap KDE Plasma X11 with `plasma-dbus-run-session-if-needed` (too)
Post by: capezotte on 20 March 2021, 05:48:48
That's correct, upstream has only /usr/bin/startplasma-x11 in the Exec= line.

Well, guess I'll keep this as a local workaround/pacman hook, since I don't have a systemd distro to compare and narrow down a more precise culprit.
Title: Re: [Request] Wrap KDE Plasma X11 with `plasma-dbus-run-session-if-needed` (too)
Post by: alium on 20 March 2021, 11:59:00
definitely! i know about this problem/issue... i have same issue with kwrite, even if DBUS_SESSION_BUS_ADDRESS is defined in env.
but
Code: [Select]
Exec=/usr/lib/plasma-dbus-run-session-if-needed /usr/bin/startplasma-x11
works not for me.
What works for me is
Code: [Select]
Exec=dbus-run-session /usr/bin/startplasma-x11
which i will add to plasma-workspace (see this report https://forum.artixlinux.org/index.php/topic,1125.15.html) similar problem has void linux too https://github.com/void-linux/void-packages/issues/21766
Title: Re: [Request] Wrap KDE Plasma X11 with `plasma-dbus-run-session-if-needed` (too)
Post by: alium on 20 March 2021, 12:12:28
fixed in plasma-workspace-5.21.3-1.1, please test and confirm, if works...
thanks for report!!
Title: Re: [Request] Wrap KDE Plasma X11 with `plasma-dbus-run-session-if-needed` (too)
Post by: capezotte on 20 March 2021, 22:41:55
Just tested, confirmed working!