Any tips to get bash to read .profile when opening konsole?
Sorry… New KDE user here, dealing with a few paper cuts…
Any tips to get bash to read .profile when opening konsole?
Sorry… New KDE user here, dealing with a few paper cuts…
You didn’t give any information really… like: WHY do you think that konsole doesn’t source ~/.profile?
That file is an excellent place for setting stuff, but not necessarily the best place for setting everything - like, for example, export MANPAGER="batman".
But there are OTHER ways of doing things, and it’s possible you have set up some kind of conflict… which would give you some issue…
The ‘issue’ is what’s missing here. You said you have paper cuts, but I can’t see a single papercut in your post.
The typical initialisation foles for bash are /etc/profile (system wide executed during login), then ~/.profile for ‘user’ entries - again, DURING LOGIN if it exists.
~/.bashrc is the initialisation file for interactive non-login shells.
You can add a like to your .bashrc to tell BASH to source your .profile:
source $HOME/.profile
alias reload="source ~/.bashrc"
alias bashrc="micro ~/.bashrc"
alias bashconfg="kate ~/.bashrc &"
Also maybe add ‘reload’ to re-source bashrc, and I set a couple of others to edit the config.
There are others, there’s ~/.bash_profile, again specific to a single user which will be read instead of ~/.profile.
Then there’s ~/bash_login that will be read during login if ~/.bash_profile doesn’t exist.
So if Konsole is not sourcing .profile it’s actually normal behaviour, because when you open a terminal emulator, it starts a non-login shell.
However, some terminals DO start a login shell by default (lookin’ at GNOME).
echo $0
Overall it can get a little confusing… I have used a couple of terminals, and a couple of shells (bash, zsh and fish)…
Imagine Konsole uses bash, Kitty uses zsh…
When I load Kitty (zsh) I want to be sure I get this:
export PAGER="bat"
But I might not want that pager to be my default for BASH, so that will go in the .zshrc config… not the .profile.
If I put it in .profile then it’s systemwide and over-rides the ‘sane defaults’ (sometimes causing problems).
what shell are you using?
what distro are you using?
what are you trying to do?
what is not working?
how do you know your login session is not sourcing ~/.profile ?
Haha I think OP fled the roost… but actually stated:
[quote=“Embattled-Neutron, post:1, topic:40286”]
Any tips to get bash to read .profile when opening konsole?
[/quote]
So really, to get bash to read .profile, just the line source $HOME/.profile would do the job.
Proper XY Problem ![]()
I have a handy alias defined in my .bashrc, it allows me to see all the sourcing my current bash shell has done from startup to now:
alias showsources="/bin/bash -lixc exit 2>&1 | sed -n 's/^+* \(source\|\.\) //p'"
Define that, and run “showsources” and you’ll see the path of every sourced file and in order.
Been too busy to get back to this…
Because the things it defines aren’t defined. And when I $source ~/.profile they are.
It turns out that switching from gdm to sddm solves this issue for KDE.
Just slow.
Thanks guys.
Ah, another case to support my claim that it’s a bad idea to mix desktops and environments on the same installation.
Thanks for clearing that up.
It has bitten me more than once over the years!