I want to launch a script (that ultimately launches an editor) with a single click in GNOME 2. To this end I have a script which sources the environment variables first and then ultimately launches the editor. The script looks something like:#!/bin/shsource variablesFileeditor $1From the terminal I can easily launch the editor with:$ ~/script myFile.txt Now, what I want to achieve is have an icon in the taskbar/Desktop, from which I can double click and start typing, just like gedit.I tried the following way:but it did not work (mostly because the environment variables could not be changed). I also tried:but a terminal window flashed and went away. No idea what happened. Any clues?
Gnome 2 desktop shortcut: Run a script having commands changing the environment
gnome
We need to launch a terminal (here xterm), and run the script (which launches the editor) as an argument to it. Later we can shortcut the launchScript into the Gnome shortcut.The launch script looks like:#!/bin/shxterm -e /path/to/editor/launch/script.shNow we point the shortcut to this file:This retains the values of environment variables, as we are running a script from a terminal.Note: In this approach the xterm window vanishes, as soon as the editor is launched. To hold this window, use the following command:xterm -hold -e /path/to/editor/launch/script.sh .