How to set path on login

Please post all general support questions for LXDE here.
Locked
Paddy Landau
Posts: 3
Joined: Mon Oct 31, 2011 1:12 pm

How to set path on login

Post by Paddy Landau »

I have Lubuntu 11.04. I need to add to the path on login.

For example:

Code: Select all

PATH="${PATH}:/mynew/bin"
I have tried:
  • ~/.bashrc -- but that works only for the current terminal session, not for the entire login session.
  • /etc/profile -- LXDE doesn't run it
  • ~/.profile -- LXDE doesn't run it
I have of course searched the LXDE site and the rest of the Internet, but I haven't been able to find the answer (maybe my search terms are wrong).

Where can I add this command in LXDE? Is there one place that applies to just the user adding the command, and another place that will apply to everyone (just as ~/.profile and /etc/profile do in Gnome)?

Thank you.
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How to set path on login

Post by amjjawad »

Hello and Welcome to LXDE Forum :)

Good to see you here ;)

I can't help you with a direct answer but I'm going to ask my team via the mailing list.
You can join the mailing list and do that yourself if you like OR you can join the IRC channel and chat with the team :)

Will keep you updated ... thanks!

P.S.
Check my signature - Lubuntu One Stop Thread.
Feel Free to contact me: http://amjjawad.net
MG&TL
Posts: 8
Joined: Sat Oct 29, 2011 7:33 am

Re: How to set path on login

Post by MG&TL »

MG&TL
Posts: 8
Joined: Sat Oct 29, 2011 7:33 am

Re: How to set path on login

Post by MG&TL »

So in your case:

Code: Select all

[Desktop Entry]
Type=Application
Exec=PATH=${PATH}:/mynew/path
Although I'm not sure on the "application" bit -checking it.
Last edited by MG&TL on Wed Nov 02, 2011 9:28 pm, edited 2 times in total.
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How to set path on login

Post by amjjawad »

I got a reply from one of Lubuntu Team Members:
at the bottom of ~/.bashrc add:

export PATH=$PATH:/mynew/bin

Will add /mynew/bin to the PATH variable

Save the new file after editting and run:

source ~/.bashrc

to apply the new changes to the current console.
Feel Free to contact me: http://amjjawad.net
MG&TL
Posts: 8
Joined: Sat Oct 29, 2011 7:33 am

Re: How to set path on login

Post by MG&TL »

Paddy Landau wrote:
  • ~/.bashrc -- but that works only for the current terminal session, not for the entire login session.
I think he wants it so that he can launch stuff in the GUI with a .desktop?
MG&TL
Posts: 8
Joined: Sat Oct 29, 2011 7:33 am

Re: How to set path on login

Post by MG&TL »

Oops, double post. :oops:

Why do you want a new $PATH, anyway?
Paddy Landau
Posts: 3
Joined: Mon Oct 31, 2011 1:12 pm

Re: How to set path on login

Post by Paddy Landau »

Sorry for taking so long to answer. Even though I am subscribed to this thread, I have not received any emails, so I did not realise you had answered.

I shall have to check this thread daily.
MG&TL wrote:... [Desktop Entry] ...
I had seen that. The problem is that the desktop entries are for applications. Setting a path it not, itself, an application. (But I tested it anyway to be sure.)
amjjawad wrote:I got a reply from one of Lubuntu Team Members: ...
Unfortunately, as MG&TL said, this works only in the current LXTerminal session, not in the entire session.
MG&TL wrote:Why do you want a new $PATH, anyway?
I have an extra folder where I keep my personal executables, and yes, you are right, many of them are GUIs. Thus, they are started from the menu, so ~/.bashrc won't work.

The path is ~/bin, which is included by default in Gnome. I want to know how to include this in Lubuntu!

I already know how to set the path globally (/etc/environment), but of course you cannot add a personal folder (/home/${USER}/bin) there.
amjjawad
Posts: 304
Joined: Mon Aug 29, 2011 1:51 am
Contact:

Re: How to set path on login

Post by amjjawad »

Yeah, same problem with notifications, that's why I don't login too much lately because I thought no one is answering.

Anyway, I sent again to my team and I'm waiting for another reply. You could also pop up on the IRC channel for quicker support :)
Feel Free to contact me: http://amjjawad.net
Paddy Landau
Posts: 3
Joined: Mon Oct 31, 2011 1:12 pm

Re: How to set path on login

Post by Paddy Landau »

After trying some new search terms, I have stumbled upon the answer!

The login script file is

Code: Select all

~/.xsessionrc
Do you think that this could be added to both of the LXDE and Lubuntu wikis?
Locked