You are not logged in.
Pages: 1
I am trying to add $HOME/.local/bin to my path.
I went to this page in the wiki: https://wiki.archlinux.org/index.php/En … _variables
According to the wiki I should edit .bash_profile.
I added the following line to it: export PATH="${PATH}:${HOME}/.local/bin"
I rebooted, and it didn't work.
I added the same path to ~/.xinitrc and ~/.xsessionsrc and it didn't work in either of those.
I then added it to ~/.pam_environment
Still didn't work. I am running XFCE4 on x.org
There must be something really stupid I am not doing.
Offline
Try using ~/.profile and proof "doesn't work":
echo $PATH
In order to have bash_profile interpreted, you must use a bash login shell (eg. logging into bash on the console) and for .xinitrc either startx or xinit or xdm… as you see, the actual login process matters, so how do you? (lightdm, lxdm,… ?)
Also post the actual files, eg. a regular mistake would be this stanza
…
exec openbox
export PATH="${PATH}:${HOME}/.local/bin"
which will not work, because "exec" replaces the shell process w/ openbox and the rest of the shell script (the export) isn't executed.
Offline
Here is my .bash_profile
[[ -f ~/.bashrc ]] && . ~/.bashrc
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
export PATH="${PATH}:/home/andy/.local/bin"
alias t="todo.sh"
The alias command does work.
I am using LightDM to login.
Offline
And what is in your bashrc? (most importantly, if the 't' alias is also defined there, the fact that it "works" is not a useful diagnostic).
Last edited by Trilby (2020-09-26 13:06:39)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Overmore, what's the output of "echo $PATH" (the PATH will not be available outside a bash, notably not in your desktop environment other than a TE running a bash)
That being said: "echo $SHELL" might also be relevant…
Offline
Adding it to .profile worked.
Here is my .bashrc
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
if [ -e $HOME/.bash_aliases ]; then
source $HOME/.bash_aliases
fi
EDIT: I do have a .bash_aliases file. I assume that's my issue. It's using .bash_aliases instead of .bash_profile?
Last edited by apastuszak (2020-09-26 16:47:15)
Offline
No, bash loads .bash_profile on login, that in turn reads your .bashrc - and your bashrc reads .bash_aliases.
But none of these are loaded by xinit/startx or display managers.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
But they should load when I run xfce terminal, should they not? That didn't seem to be happening.
Offline
should … seem
Again…
echo $SHELL $PATH
But no, because
In order to have bash_profile interpreted, you must use a bash login shell (eg. logging into bash on the console)
and the shell inside the VTE on a desktop session is not a login shell - you're already logged in at that point.
The bashrc would be interpreted there.
Offline
So, I have to assume that the Arch Wiki is written with the assumption that you're logging into the machine from bash and not from a GUI. I followed the instructions in the wiki and it said to add the command to my .xinitrc. I did that and it did not work. So, I have to assume that .xinitrc is only read if you login via bash and then type startx.
Offline
I followed the instructions in the wiki
No, you didn't: https://wiki.archlinux.org/index.php/Li … _variables
Offline
Also you don't have to login w/ bash to get xinitrc read - only run something that sources it (xinit, startx, xdm and possbily other stuff)
Read teh wiki again. And read more carefully.
Offline
Pages: 1