Bash not sourcing .profile automatically in Debian 11
So, in order to avoid typing "flatpak run", every time I need to run a flatpak program from the terminal, to have gui programs installed using nix appear in my applications menu(rofi, in this case), and to avoid typing the entire path to my .local/bin, I had added the following lines to my .profile:
set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
export PATH="$HOME/bin:$PATH"
fi
set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
export PATH="$HOME/.local/bin:$PATH"
fi
for desktop entries for packages installed using Nix
.profileis only sourced when the shell is a login shell. Most shells started by terminal emulators under a GUI are not login shells.
Depending on how you connect to a machine, you may or may not get a login shell. Through SSH or similar may well get you a login shell. Using the text-console (usually through Ctrl+Alt+F1 through F6 on modern distros) also yields a login shell.
Try putting things in your .bashrc instead. That one is sourced regardless of login shell or not.
If you're not using bash, substitute the relevant file. .zshrc and .config/fish are the main two.
Thanks, that works with the flatpaks.
However, it doesn't seem to work with nix packages.
I mean rofi doesn't detect the .desktop files for packages installed using nix.