Bug 435050 - Disabled runners cannot be used in 'single runner mode' (invoked via dbus)
Summary: Disabled runners cannot be used in 'single runner mode' (invoked via dbus)
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.21.3
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-28 07:38 UTC by Kishore Gopalakrishnan
Modified: 2021-04-23 08:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.82
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2021-03-28 07:38:27 UTC
SUMMARY
If a runner is disabled in krunner's settings, explicitly requesting it in 'single runner mode' via dbus (say `qdbus org.kde.krunner /App org.kde.krunner.App.displaySingleRunner locations` ) also does not work. 

This used to work earlier, and I would like this feature for the following use case: I have configured my system such that pressing 'Alt' brings up krunner with a global menu runner [ https://github.com/ArturGaspar/krunner-appmenu ] enabled. However, I do not want this enabled all the time, since it clutters the main krunner results. Earlier, I used to be able to disable it in the krunner settings, and everything would work as expected.

STEPS TO REPRODUCE
1. Open krunner's settings and disable the 'locations' runner
2. Run `qdbus org.kde.krunner /App org.kde.krunner.App.displaySingleRunner locations` in a terminal

OBSERVED RESULT
Krunner opens after step 2, but without any runners enabled.

EXPECTED RESULT
Krunner should open with the requested runner. Everything works as expected if I also enable the required runner in krunner's settings, but I think the runner should still be loaded in this case as the user has explicitly requested it.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.10.24-1-lts

ADDITIONAL INFORMATION
Comment 1 Alexander Lohnau 2021-03-28 08:41:33 UTC
Huh that actually surprises me as a usecase. Especially because the single runner stuff was broken for quite some time. I will look into writing a fix for that.

In the meantime you could run:
>kwriteconfig5 --file ~/.local/share/kservices5/plasma-runner-krunner_appmenu.desktop  --group "Desktop Entry" --key "X-Plasma-Runner-Match-Regex" '^$'; kquitapp5 krunner

As a workaround, this will only produce matches when the runner is in the single runner mode. But you still need to have it enabled.
Comment 2 Kishore Gopalakrishnan 2021-03-28 08:54:49 UTC
(In reply to Alexander Lohnau from comment #1)
> In the meantime you could run:
> >kwriteconfig5 --file ~/.local/share/kservices5/plasma-runner-krunner_appmenu.desktop  --group "Desktop Entry" --key "X-Plasma-Runner-Match-Regex" '^$'; kquitapp5 krunner
> 
> As a workaround, this will only produce matches when the runner is in the
> single runner mode. But you still need to have it enabled.

This works. Thanks!
Comment 3 Alexander Lohnau 2021-03-28 08:58:04 UTC
I will submit a MR to add it to the readme of the github repo you have sent. And also a tiny bit of tweaking for the config file there ;)

I already have a local patch for this available, but will need to think if this can be solved a bit cleaner. Generally speaking the single runner mode stuff in the framework needs a bit cleaning up^^
Comment 4 Alexander Lohnau 2021-04-04 17:23:01 UTC
See https://invent.kde.org/frameworks/krunner/-/merge_requests/62.

I have also done refactoring + cleanup + autotests, that is why there are a lot of commits :)
Comment 5 Alexander Lohnau 2021-04-23 08:05:29 UTC
Git commit 12d34b9cd567f8c972b9e6fe4503364a75e5d6c3 by Alexander Lohnau.
Committed on 23/04/2021 at 06:19.
Pushed by alex into branch 'master'.

runnermanager: Allow loading runners in single runner mode if they are disabled
FIXED-IN: 5.82

M  +22   -7    src/runnermanager.cpp

https://invent.kde.org/frameworks/krunner/commit/12d34b9cd567f8c972b9e6fe4503364a75e5d6c3