Support for environment variables or desktop files in Preferred Applications
Submitted by Harish Rajagopal
Assigned to Xfce Bug Triage
Description
I would like to configure default applications using environment variables for use with exo-open.
In my use case, I want to set Alacritty as the default terminal emulator, but with the environment variable WINIT_HIDPI_FACTOR=1. The way I've currently registered this in the Preferred Applications GUI, in the Utilites tab for the Terminal Emulator, is:
bash -c 'env WINIT_HIDPI_FACTOR=1 alacritty'
This works if I run the following:
$ exo-open --launch TerminalEmulator
However, if I pass additional arguments, they are ignored. For example:
$ exo-open --launch TerminalEmulator htop
This simply opens Alacritty without opening htop. Similarly, when certain .desktop files are set to open in the terminal, they will not open. Instead, only an ordinary terminal window opens.
The above setting in the Preferred Applications GUI is the only way in which the first command can run. I have tried the following setups:
bash -c 'env WINIT_HIDPI_FACTOR=1 alacritty "%s"' bash -c 'env WINIT_HIDPI_FACTOR=1 alacritty' "%s" bash -c env WINIT_HIDPI_FACTOR=1 alacritty "%s"
None of them work.
I have already configured the desktop file for Alacritty to have the required environment variables set. Is there a way to get exo-open to use the desktop file? Or is there another way to pass environment variables in the Preferred Applications GUI along with possible command line options ("%s")?
This issue has been discussed here: https://forum.xfce.org/viewtopic.php?id=13829
Version: 0.12.11