Arch Linux/Neofetch x2?

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 :grin:

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. :grinning:

When I mentioned a nefarious alias - what about an alias where you forgot put in alias nf= in front of neofetch? :grin: 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. :stuck_out_tongue_closed_eyes:

For me it was called in 2 separate files - once by name and once by alias… :blush:
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" ? :thinking:

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

/etc/bash.bashrc

If not running interactively, don’t do anything

[[ $- != 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

/etc/profile

Set our umask

umask 022

Append our default paths

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

Load profiles from /etc/profile.d

if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -r “$profile” && . “$profile”
done
unset profile
fi

Source global bash config, when interactive but not posix or sh mode

if test “$BASH” &&
test “$PS1” &&
test -z “$POSIXLY_CORRECT” &&
test “${0#-}” != sh &&
test -r /etc/bash.bashrc
then
. /etc/bash.bashrc
fi

Termcap is outdated, old, and crusty, kill it.

unset TERMCAP

Man is much better than us at figuring this out

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.

1 Like

Interesting thanks, is there something i can comment out with a # without breaking anything lol. :rofl:

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?