.profile not finding new ~/bin directory - SOLVED

Kernels & Hardware, configuring network, installing services

Re: .profile not finding new ~/bin directory

Postby Dai_trying » 2019-12-07 08:22

When you added the .xsessionrc file you would have to re-boot (or maybe just logout and back in might work) for it to take effect, the difference is that with this being in .bashrc file the $PATH is only set when using a terminal (with bash) and not system-wide, I have used this method for quite some time and it is only since this thread provided me with the (now preferred) alternative of using .xsessionrc the path will always be available.

For instance if you use .bashrc and have a script in your ~/bin/ folder called myscript.sh and try to run it from the application finder (Alt+F2) it will not find your myscript.sh file, whereas if you put the $PATH direction into .xsessionrc it will be available globally and can be run from Application Finder (after a reboot).
Posts: 938
Joined: 2016-01-07 12:25

Re: .profile not finding new ~/bin directory

Postby Head_on_a_Stick » 2019-12-07 09:32

I've just tested the live version of Cinnamon and it doesn't read ~/.profile, which is strange because my GNOME desktop does. Perhaps this is a bug in the Cinnamon desktop.

I can confirm that ~/.xsessionrc works in Cinnamon, make sure you log out & back in again to see the effect (as Dai notes).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Posts: 12497
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: .profile not finding new ~/bin directory

Postby DocTomJP » 2019-12-10 11:40

Gentlemen : you have steered me to success!

I set the xsessionrc file as you instructed, and now I have the ~/bin file appended.

For information, the difference between the latest and the earlier attempt (that failed) was simply that after deleting the original .bashrc file, and importing the one from skel, the files created thereafter were set to root as owner. This I did not notice on the first attempt with .xsessionrc. But on the latest successful pass at it, I did notice the root ownership, so I changed the owner to me, and all was good after that.

So I am up and running with the ~/bin file in the PATH, as required.

I am extremely grateful for all your help. Not only have you got my issue solved, but you have taught me a few things in the process.

So regards and very many thanks, Tom.
Posts: 30
Joined: 2015-06-08 05:21

Re: .profile not finding new ~/bin directory

Postby Dai_trying » 2019-12-10 13:19

You're welcome, if you could mark the post as solved (edit title of first post) others could find it easier in the future.
Posts: 938
Joined: 2016-01-07 12:25


Return to System configuration

Who is online

Users browsing this forum: No registered users and 9 guests