linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.56k stars 742 forks source link

panel-run-dialog does not search $PATH directories #6070

Open ManuelSchneid3r opened 7 years ago

ManuelSchneid3r commented 7 years ago

I have several scripts in ~/.local/bin. ~/.local/bin is in PATH. However in the run dialog (Alt+F2) the scripts are not found. Cinnamon 3.2.1.

JosephMcc commented 7 years ago

Is this a new problem or did it occur in previous cinnamon versions as well?

ManuelSchneid3r commented 7 years ago

I am not absolutely sure since I use it rarely. But I think it is new since otherwise it would mean I did not start any of these scripts in the recent years using cinnamon.

Am 08.12.2016 um 10:27 schrieb JosephMcc notifications@github.com:

Is this a new problem or did it occur in previous cinnamon versions as well?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Odyseus commented 7 years ago

Hello, everybody.

I can confirm the same behavior in Cinnamon 3.0.7. None of the executables in ~/.local/bin are recognized by the Alt + F2 dialog.

In my case, ~/.local/bin wasn't in my PATH, so they weren't available from a terminal either. But after adding ~/.local/bin to my PATH, they are available from my terminals, but still not available on the Alt + F2 dialog.

ManIVIctorious commented 7 years ago

Did you set your path variable in .profile or in .bashrc? Bashrc is bash specific, so you would have to source your path in .profile

Odyseus commented 7 years ago

Hello, @ManIVIctorious.

Yes, I have all my PATH's exports in ~/.profile, not on ~/.bashrc. More precisely, this is the line I use to add ~/.local/bin to my PATH:

export PATH="/home/$USER/.local/bin:$PATH"

But I think that I spoke too soon. To reload the ~/.profile, I logged off and logged back in and the Alt + F2 dialog didn't have my custom scripts/commands available. But then I decided to restart my system, and all my scripts/commands stored in ~/.local/bin were effectively available from the Alt + F2 dialog.

So, @ManuelSchneid3r, if you have your exports in ~/.bashrc, move them to ~/.profile. Tested on Linux Mint 18 with Cinnamon 3.0.7 and the latest version of Cinnamon installed on ArchLinux.

ManuelSchneid3r commented 7 years ago

It is in .profile.

✔ ~ $ cat .profile 
export PATH="$PATH:~/.local/bin/:$(ruby -e 'print Gem.user_dir')/bin"
✔ ~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.local/bin/:/home/manuel/.gem/ruby/2.3.0/bin:~/.local/bin/:/home/manuel/.gem/ruby/2.3.0/bin
Odyseus commented 7 years ago

It it in .profile.

✔ ~ $ cat .profile 
export PATH="$PATH:~/.local/bin/:$(ruby -e 'print Gem.user_dir')/bin"
✔ ~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin> /vendor_perl:/usr/bin/core_perl:~/.local/bin/:/home/manuel/.gem/ruby/2.3.0/bin:~/.local/bin/:/home/manuel/.gem/ruby/2.3.0/bin

@ManuelSchneid3r: The ~ might not be expanded. Change ~/.local/bin/ in your export to /home/$USER/.local/bin and check again.

ManuelSchneid3r commented 7 years ago

Where do all those variables get set? Does $HOME work as well?

Odyseus commented 7 years ago

@ManuelSchneid3r

Where do all those variables get set? Does $HOME work as well?

A quick search on the net didn't shed much light as to who (or is it whom?) sets the variables. This StackExchange question has some info.

In my systems (Linux Mint and Arch Linux), the $HOME and $USER variables are set. You can easily check if a variable is set with env | grep "HOME" for example. Or simply with env to see all variables.

Like I already said in my previous message, the export example that I posted works and makes all commands/scripts stored in ~/.local/bin available from the Alt + F2 dialog.

ManuelSchneid3r commented 7 years ago

Okay I used $HOME now. The shell expands this to /home/manuel/:

 ~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/manuel/.local/bin/:/home/manuel/.gem/ruby/2.3.0/bin

This is set in .bashrc as well as .bash_profile (which sources bashrc). Afaik .profile is for the Bourne Shell.(sh). @ManIVIctorious Why do you think I have to use .profile? My login shell is bash.

ManuelSchneid3r commented 7 years ago

@JosephMcc Is it intended that .profile (which is a file of the Bourne Shell (sh)) is used if my login shell is bash.

ManIVIctorious commented 7 years ago

As far as I know cinnamon only sources the ~/.profile file and since it doesn't read your .bashrc file it couldn't know of the PATH if it would be set there. I have to admit I don't really know if its necessary to put the PATH in .profile, but on my laptop, netbook and on my desktop PC it works flawlessly with the PATH set there.

using cinnamon 3.2.1 here cat .profile export PATH=$PATH:~/Dokumente/bin export PATH=$PATH:~/Desktop/masterarbeit/bin

ManuelSchneid3r commented 7 years ago

Shouldn't cinnamon get the user shell (/etc/pwd) and then read the conforming dotfiles (.profile, .bashprofile, .zprofile etc)?

maxkoryukov commented 7 years ago

The issue still here

Linux Mint 18.1 Serena Cinnamon 3.2.7 Gtk 3.18.9

jkirk commented 5 years ago

Any update on this? I face this issue too.

My $HOME/.profile looks like this:

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

(and yes, $HOME/bin does exists).

I am running Cinnamon 3.2.7 with Debian/stretch and this used to work with LMDE 2.

jkirk commented 5 years ago

I tried to debug this a little bit, my current workaround is to start a terminal and run:

cinnamon-launcher --replace &

After doing so, the scripts in $HOME/bin are found by the launcher.

If someone can tell me where to look at, I can try to help to pinpoint the problem.