Re: PATH ~/bin under gnome



On Tue, 21 Nov 2006 07:31:18 -0500
"Todd Slater" <dontodd@xxxxxxxxx> wrote:

On 11/21/06, Peter Garrett <peter.garrett@xxxxxxxxxxxxxxx> wrote:
On Mon, 20 Nov 2006 17:45:40 -0500
"Todd Slater" <dontodd@xxxxxxxxx> wrote:

On 11/20/06, rodrigochinaski <rodrigo.chinaski@xxxxxxxxx> wrote:
Greetings...

I would like to add my ~/bin in the PATH. I already uncommented the
following lines on my ~/.bash_profile, but it only works on the console,
not on the gnome environment.


# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH="${PATH}":~/bin
fi

What's the "cleanest" way to do this?

Just add that to the end of your ~/.bashrc file. You'll probably have
to log out and back in for it to take effect.

No. Gnome doesn't read ~/.bashrc - it only applies to the console
or terminal emulators.

I think the file to use would be ~/.gnomerc , which doesn't exist by
default, but is executed if present when you log in to GNOME.

Edit: Just tried it and it works as I suggested . An Xdialog script in
~/bin "works" with it, and so does ~/bin/mailspeak ;) -

#!/bin/bash
# "Just for fun"
echo " `echo $USER`. you have mail" | festival --tts

I only call items in ~/bin from a terminal so adding it to ~/.bashrc
works for me. How else do you call those scripts?

Right - ~/.bashrc works when you call stuff from the command line. If, for
example, you want to run a script that has a graphical front end ( using
zenity, Xdialog or kdialog for instance), typing the command for the
script in ~/.bashrc will work fine.

If, on the other hand, you want to use a GNOME menu item or panel launcher
etc. , you would have to type the whole path. ( example: your launcher
would have the command field as /home/peter/timer ) By placing the same
path generating lines in ~/.gnomerc , you ensure that *GNOME* knows ~/bin
is in your PATH. Thus, a launcher or graphical menu item with the command
"timer" ( without quotes ) will then work.

Personally I can't think of a use case where this is particularly
important, but my interpretation was that this would be what the OP
wanted .

Since ~/bin is placed first in the list of directories in the
PATH by that snippet from ~/.bash_profile , I suppose for example, that if
you had two identically named executables, doing this would make sure the
one in your personal directory ran on menu click, instead of the "global
default". That could be handy for people who have no root access but want
to run an updated app installed in ~/bin.

On the other hand, it isn't hard to edit a menu or launcher to include a
full path.

Peter

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: PATH ~/bin under gnome
    ... not on the gnome environment. ... Right - ~/.bashrc works when you call stuff from the command line. ... you want to run a script that has a graphical front end (using ... If, on the other hand, you want to use a GNOME menu item or panel launcher ...
    (Ubuntu)
  • Re: PATH ~/bin under gnome
    ... but is executed if present when you log in to GNOME. ... you want to run a script that has a graphical front end (using ... If, on the other hand, you want to use a GNOME menu item or panel launcher ... would have the command field as /home/peter/timer) By placing the same ...
    (Ubuntu)
  • Re: newbie question: how to run a shell script from launcher
    ... I'm using RH9 with GNOME desktop. ... I'm using GNOME, in GNOME I could create a launcher, in it I have ... to create a launcher to run a script. ... the command entry, just like the way I ran it in the install directory ...
    (comp.os.linux.misc)
  • Re: Customize xfterm4 for a terminal-bound program in Xfce
    ... > launcher in the Panel for a program running on a terminal, ... script, which I then call from the window manager. ... The last command ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: How to tell GNOME menu items about environment variables?
    ... I am trying to get a Japanese input method to work with an application ... launched from GNOME. ... settings in the GNOME menu item command. ... modified is the launcher for MS Word 2003 installed using Codeweavers ...
    (Ubuntu)

Quantcast