Figured I would ask here, on my Arch Linux/Xfce install I put neofetch in my bash.bashrc file and after saving it and re-opening a terminal neofetch launches twice in terminal lol? Tried to figure out why, still not sure. Any ideas?
Thanks!
Figured I would ask here, on my Arch Linux/Xfce install I put neofetch in my bash.bashrc file and after saving it and re-opening a terminal neofetch launches twice in terminal lol? Tried to figure out why, still not sure. Any ideas?
Thanks!
First thing I would look for is whether it is called by .bashrc and by whatever file it calls. (on mine .bashrc-personal). The second thing is whether it is called near the start - and near the end! (Iāve done that, too). Of course, it could be a nefarious alias as well ![]()
Iāve tried to add it both at the top and to the bottom, it does it for both neofetch & screenfetch. not a huge deal i can always just type it in lol. Still want to know why though. ![]()
When I mentioned a nefarious alias - what about an alias where you forgot put in alias nf= in front of neofetch?
Actually, I have similar happening over on an Arch setup that I hadnāt investigated yet. May be something weird going aroundā¦
Iāll go over to that setup and see whatās upā¦
When I put nf=neofetch & launch terminal nothing happens. ![]()
For me it was called in 2 separate files - once by name and once by alias⦠![]()
BTW - hereās the alias I use - suitably modified for Arch or EndeavourOS of courseā¦
alias nf='cls && tput setaf 3;figlet ArchOS rolling && neofetch --ascii_colors 12 --colors 10 11 11 12 10 7'
and
alias nf='cls && tput setaf 3;figlet EndeavourOS && neofetch --ascii_colors 12 --colors 10 11 11 12 10 7 '
You have both of those in your bash.bashrc? Interesting, Iāve always just added neofetch or screenfetch & that was it.
I added screenfetch at the end of my /etc/bash.bashrc in an Arch install and it launches only once when I execute bash. Are you sure you havenāt put it in your userās .bashrc as well?
Nope, i just added it to my bash.bashrc.
Canāt reproduce (even after installing neofetch) unless I add screen/neofetch either to both bashrc files or have several occurrences in one of them.
Whatās output of this?
cat ~/.bashrc /etc/bash.bashrc | egrep -o "(screen|neo)fetch"
There may be an alias defined somewhere thatās being called as well, as @freebird54 said.
It does nothing, turns my $ from green to red. But other then that there is no output.
echo "$0 $SHELL" ? ![]()
This is what I get
/bin/bash /bin/bash
I donāt know then. Maybe you need to post the contents of your ~/.bashrc and /etc/bash.bashrc and of everything sourced there. Or maybe it is really a bug and somebody can confirm that.
~/.bashrc is this - source /etc/profile
[[ $- != i ]] && return
[[ $DISPLAY ]] && shopt -s checkwinsize
PS1=ā[\u@\h \W]$ ā
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }āprintf ā\033]0;%s@%s:%s\007ā ā${USER}ā ā${HOSTNAME%%.*}ā ā${PWD/#$HOME/~}āā
;;
screen*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }āprintf ā\033_%s@%s:%s\033\ā ā${USER}ā ā${HOSTNAME%%.*}ā ā${PWD/#$HOME/~}āā
;;
esac
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
source /etc/profile.d/ps1.sh
Thats both
What is in /etc/profile
umask 022
appendpath () {
case ā:$PATH:ā in
:"$1":)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
appendpath ā/usr/local/sbinā
appendpath ā/usr/local/binā
appendpath ā/usr/binā
unset -f appendpath
export PATH
if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -r ā$profileā && . ā$profileā
done
unset profile
fi
if test ā$BASHā &&
test ā$PS1ā &&
test -z ā$POSIXLY_CORRECTā &&
test ā${0#-}ā != sh &&
test -r /etc/bash.bashrc
then
. /etc/bash.bashrc
fi
unset TERMCAP
unset MANPATH
I think this may be the problem.
It looks like /etc/profile calls /etc/bash.bashrc. However, that file should also be sourced by bash natively for an interactive shell. I suspect your bash.bashrc is being sourced twice due to your explicitly sourcing /etc/profile in your ~/.bashrc.
That being said, I am not a bash expert by any means. I mostly used ksh until I switched to zsh.
Interesting thanks, is there something i can comment out with a # without breaking anything lol. ![]()
I donāt think thatās the case. It looks like the default /etc/profile, I have pretty much the same.
Maybe I am missing it, but I canāt find where you call neofetch in your /etc/bash.bashrc⦠And whatās in /etc/profile.d/ps1.sh?