SUMMARY Often when I need to take screenshots of applications or verify the name of a menu option in English I use LANG=C applicationname. Typing commands to open applications from the terminal instead of KRunner has two distinct disadvantages: 1) Opening an application from a terminal means opening an application to open another application, unlike Kickoff and KRunner, which are typically already present. 2) Commands (and their corresponding applications) are bound to the terminal, and as such the user needs to either create a new terminal instance for each application or add an & to the end of the command if one doesn't want to keep the terminal open afterwards. KRunner does not have these disadvantages. It would be fairly convenient and quicker to run commands using environment variables in KRunner. As for implementation, I think that although not discoverable at all, being able to use environment variables inline (LANG=C applicationname) is very flexible as it would allow to easily and quickly use another environment variable value for each application, whereas being able to set environment variables prior to running commands (similarly to KCron) is pretty discoverable but not as flexible, as it would require going to a specific, dedicated section first in order to change an environment variable, which would be applied to all applications run by KRunner.
I think this makes sense as an advanced feature. I'm kind of surprised that it doesn't just automatically work, in fact.
*** Bug 180115 has been marked as a duplicate of this bug. ***
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/172
Git commit 5feeab7560b92a8e4181224d29af69730d59107c by Alexander Lohnau. Committed on 28/07/2020 at 13:50. Pushed by dfaure into branch 'master'. Add overload to invoke terminal with ENV variables Because this is an exported class we have to add an overload. M +18 -3 src/kdeinit/ktoolinvocation.cpp M +22 -0 src/kdeinit/ktoolinvocation.h M +9 -1 src/kdeinit/ktoolinvocation_win.cpp M +9 -1 src/kdeinit/ktoolinvocation_x11.cpp https://invent.kde.org/frameworks/kservice/commit/5feeab7560b92a8e4181224d29af69730d59107c
I wonder, if this could be related to the broken support of environment variables in *.desktop files? bug 167502 comment #4
IMO it seems not related, because this bug is only about shell commands and not the desktop service stuff.
Git commit dc70225a7c1a373c0db1fe1054ee7048acd95115 by Alexander Lohnau. Committed on 11/08/2020 at 07:28. Pushed by alex into branch 'master'. Allow ENV variables in shell runner FIXED-IN: 5.20 M +42 -12 runners/shell/shellrunner.cpp M +1 -0 runners/shell/shellrunner.h https://invent.kde.org/plasma/plasma-workspace/commit/dc70225a7c1a373c0db1fe1054ee7048acd95115