help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make GUI applications inherit PATH


From: Chris Elvidge
Subject: Re: How to make GUI applications inherit PATH
Date: Tue, 9 Mar 2021 14:07:51 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 09/03/2021 12:37 pm, Fernando Basso wrote:
I am creating a launcher in Xfce4 to run `gvim -f'. When I click the
launcher, gvim opens and complains it cannot find nodejs, which I
install through nvm (node version manager), which is added to `PATH' in
`~/.bashrc'.

I tried creating a wrapper script, something like this:

        #!/usr/bin/env -S bash --login
        gvim -f "$@"

It still doesn't pass `PATH' as configured in my `~/.bashrc' to gvim. (I
passed `--login' because according to `man bash' it would cause
`~/.bashrc' to be read).

If I run that wrapper from the terminal (with bash as the shell), then
it works (I can `:echo $PATH' from gvim and see all my configured
paths), just like if I had run `gvim -f' directly. If I run that wrapper
script from gmrun or xfce4-appfinder then again `PATH' inside gvim
contains only some default system directories and not my configured
paths.

I have noticed something similar to Zim Wiki, which seems to inherit my
shell exported stuff if opened from the terminal, but not if opened from
some GUI launcher.

If these applications inherit the `PATH' when I run them directly from
the terminal, I guess it should work from wrapper scripts if written
correctly.

So my question is how could I create a bash wrapper script that would
cause these GUI apps to inherit exported `PATH' from my bash config
files?





Have you exported the PATH variable in .bashrc?

--
Chris Elvidge
England




reply via email to

[Prev in Thread] Current Thread [Next in Thread]