Here on Artix I don't see a ~/.profile so I guess it is not sourced.
I put in ~/.bash_profile and in ~/.bashrc the paths:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
That works when I open a terminal but not for sxhkd or dmenu.
In what file should I put them?
Adding your home path like that is a big security hole, because unprivileged processes can put a pseudo command which will overwrite the system one, so say you think you run "ls" but you might run "ls" in your .local/bin which was put there by malware - unlikely, but anyway, it should go after the other existing paths. If you want your own scripts to be globally available on the system, you can use /usr/local/bin which requires superuser permissions to write to. Also things from there can be links to anywhere, including your home dir if you wanted, although more likely you would install your own system wide things in /opt. But for the precise answer to your question if you really wanted to do it like that - I don't know exactly, perhaps someone else does!
Please check out Environment variables (https://wiki.archlinux.org/title/Environment_variables).
You would have to modify the paths to your specifications.
Or you could create a custom profile script in /etc/profile.d/<script>.sh.
I created a custom profile script in /etc/profile.d/<script>.sh, it works for sxhkd but not for dmenu.
So maybe is it something specific to dmenu?
Or from the Arch wiki:
Also /etc/profile doesn't affect it.
I am using "dmenu_run".
Arch dmenu wiki entry (https://wiki.archlinux.org/title/Dmenu)
Superuser site page does have some other possibilities: dmenu doesn't set environment variable as per my .bash_profile when running Emacs (https://superuser.com/questions/506186/dmenu-doesnt-set-environment-variable-as-per-my-bash-profile-when-running-emac).
First suggestion was to use ".xsessions".
The second try ".xinitrc".
dmenu needs /etc/enviroment or ~/.xsession.
I am using a dm to start the GUI, ~/.xinitrc is ignored.
Only nodm uses it since it is some kind of wrapper for startx.
sxkbd needs /etc/profile.d/script, I guess /etc/profile is fine too.
So I am using /etc/enviroment and /etc/profile.d/script, those should work on wayland too.