Add gnome ubuntu application luncher with custom shell environmentBy neokrates, written on March 22, 2010
You have some script or application which needs shell(bash!?) environment. If you add it to the Application Luncher, it misses variables and script fails.
The problem is that you might have your variables in bashrc or file like this, and they are not been read in this case. In this howto, I will add Java path to the PATH environment variable so that my eclipse can start from script. But solution would work for any similar case…
My eclipse directory is ECLIPSE_HOME.
Create file with your variables and export them. Call the file “vars”:
DEVTOOLS=/opt/dev JAVA_HOME=$DEVTOOLS/lang/jdk export JAVA_HOME PATH=$PATH:$JAVA_HOME/bin:.
Create starter script. I.e., mine is called “estarter”:
#!/bin/bash cd /opt/dev/ide/eclipse source vars ./eclipse
The source vars command tells bash to read variables from my vars file.
Make “estarter” executable:
ECLIPSE_HOME> chmod a+x estarter
Now drag the icon of estarter from File Browser to the Gnome Starter panel. Give a name for new luncher.
💡 Remark: You can put vars in your ~ (home directory). That will spare you the problem of double configuration.
Then, you use it from .bashrc, .profiles etc. like this:
INCOMING SEARCH TERMS