Add gnome ubuntu application luncher with custom shell environment

By neokrates, written on March 22, 2010

howto

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • Your skill as shell programmer is?

    • No skill (35%, 7 Votes)
    • FreeTime coder (acceptable) (25%, 5 Votes)
    • Developer (good) (15%, 3 Votes)
    • Novice (15%, 3 Votes)
    • Admin (very good) (10%, 2 Votes)
    • Guru (perfect) (0%, 0 Votes)

    Total Voters: 20

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:

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.

Step 1. 

In ECLIPSE_HOME:
Create file with your variables and export them. Call the file “vars”:

1
2
3
4
DEVTOOLS=/opt/dev
JAVA_HOME=$DEVTOOLS/lang/jdk
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin:.

Step 2.

Create starter script. I.e., mine is called “estarter”:

1
2
3
4
#!/bin/bash
cd /opt/dev/ide/eclipse
source vars
./eclipse

 
The source vars command tells bash to read variables from my vars file.

Step 3.

Make “estarter” executable:

ECLIPSE_HOME> chmod a+x estarter

Step 4.

Now drag the icon of estarter from File Browser to the Gnome Starter panel. Give a name for new luncher.

Done.
[i] 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:

source vars
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: -1 (from 1 vote)
0 votes 'YES'  1 votes 'NO'

LEARN MORE (amazon bookstore)

TAGS

RELATED
Pages
Posts
    nope :(

SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

INCOMING SEARCH TERMS


Leave a Reply