Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
176
rated 0 times [  176] [ 0]  / answers: 1 / hits: 84199  / 2 Years ago, mon, march 14, 2022, 7:30:47

Is there a way to set the enviroment variable in .desktop file?
I'm trying to run application (eclipse) with custom gtk style, so basically I want to get the following result by runing a .desktop file:



GTK2_RC_FILES=gtkrc.custom /path/to/eclipse


I've tryied to put it in a bash script and run it from the .desktop file, but then it does not integrate well with the Unity launcher.


More From » unity

 Answers
3

You can add an environment variable to an application by editing its .desktop file. For example, to run "digiKam" with the environment variable APPMENU_DISPLAY_BOTH=1, find the corresponding digikam.desktop file and add the setting of the variable, via the env command, to the entry "Exec":


Exec=env APPMENU_DISPLAY_BOTH=1 digikam -caption "%c" %i

In your case:


Exec=env GTK2_RC_FILES=gtkrc.custom /path/to/eclipse

[#37953] Monday, March 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elopingapo

Total Points: 206
Total Questions: 110
Total Answers: 114

Location: Guam
Member since Tue, Nov 29, 2022
1 Year ago
;