Want to use Kando, which is a Pi menu app launcher which seems to open apps through bash/commands, and I’m wondering if the environment variables listen in KDE Menu get passed on even through opening apps through command line? (ex. just typing ‘Dolphin’ to open the Dolphin file manager)
Hard to parse your query ‘if environment variables listen in KDE Menu get passed on even through opening apps through command line?’.
However, I can confirm that typing ‘dolphin’ in the ‘KDE Menu’ will open the Dolphin file manager…
![]()
That doesn’t answer my question, Kando opens apps through commands (‘/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/dolphin-emu-wrapper org.DolphinEmu.dolphin-emu’ to open the dolphin-emu flatpak), and I’m wondering if the env variables listen in KDE Menu get passed on, even through opening apps through commands.
Most likely if the app is launched via a CLI then it inherits all exported environment variables. You can see them with export.
Ok, I confess… I had no idea you installed it as a Flatpak - that’s not mentioned in the link I sent you (the source), and I have no idea what ‘dolphin-emu-wrapper’ is either, I don’t know what operating system you’re running or anything else.
You can set environment variables in KDE Menu.
Kando looks like a launcher executing the command you provide, based on electron if Im’ not mistaken - inheriting the environment of the session it is started in - and in this case, that looks like it’ll be the flatpak environment session.
Flatpak run will be executed in the environment it receives from kando…
Then the ‘Dolphin Emulator’ is going to run in a sandbox, but might inherit some variables from the flatpak command that launched it.
But overall, my final answer:
This is so convoluted, I couldn’t say one way or the other - why don’t you just try it?
This is probably more a question for Kando.
When you edit an application’s entry in KDE’s menu editor you are essentially creating (or modifying) a so-called .desktop file in $HOME/.local/share/applications
Any launcher consuming these files should launch the application in the same way, e.g. using the same additional environment variables.
If Kando is using that standard is something their documentation or community will have to answer.
Shells, e.g. bash, usually don’t use these file but run the executable directly.
The environment these processes see will be the one the shell itself has at the moment of launch.
Which could be different to the environment the terminal was launched with as interactive shells often read additional configuration files.
I think this part of the documentation answers your question:
You’re supposed to see what command gets run in the .desktop files @krake mentioned and copy that into your Kando run configuration. Which leads to the answer to your question:
No, kando will not parse .desktop files directly and thus will not pass environment variables defined in the KDE Menu Editor (which is just a GUI editor for .desktop files).
A simple example would be:
Say, you have set up an environment variable in your .desktop (e.g. KDE Menu Editor) for Dolphin (the file manager) which is:
TEST=value
You then set up your command in Kando like this:
TEST=value /usr/bin/dolphin
For your Dolphin Emulator (≠ Dolphin file manager) as a flatpak, it would be:
/usr/bin/flatpak run --env=TEST=value --branch=stable --arch=x86_64 --command=/app/bin/dolphin-emu-wrapper org.DolphinEmu.dolphin-emu
These examples are just off the top of my head, no guarantees.
I seem to have encountered the same issue. I believe KDE’s environment variables are only inherited from the system environment or from ~/.config/plasma-workspace/env/export.sh. By default, it does not read .bashrc or .zshrc in the user’s home directory. If you want system-wide settings, you should modify files such as /etc/environment or /etc/profile.