To get Neofetch to run automatically when you open the terminal on Mint Linux, you can add it to your shell configuration file. Here's how you can do it:
For Bash Users
If you're using Bash (the default shell for many Linux distributions, including Mint), follow these steps:
-
Open the Terminal: Just open your terminal.
-
Check if you're using Bash: You can verify if you're using Bash by running:
echo $SHELL
If it outputs /bin/bash, you're using Bash.
-
Edit the Bash Configuration File: You can edit the .bashrc file with a text editor like Nano or Vim. To open it in Nano, run:
nano ~/.bashrc
-
Add Neofetch Command: Add the following line at the end of the file:
neofetch
-
Save and Exit: Press Ctrl + O, Enter to save, and Ctrl + X to exit.
-
Apply Changes: To apply the changes, either restart the terminal or run:
source ~/.bashrc
For Zsh Users
If you're using Zsh, which is the default shell in newer versions of Mint Linux, you'll need to edit a different file:
-
Verify if you're using Zsh:
echo $SHELL
If it outputs /bin/zsh, you're using Zsh.
-
Edit the Zsh Configuration File: Open the .zshrc file with your preferred text editor, like so:
nano ~/.zshrc
-
Add Neofetch Command: Add the following line at the end of the file:
neofetch
-
Save and Exit: Press Ctrl + O, Enter to save, and Ctrl + X to exit.
-
Apply Changes: Restart the terminal or run:
source ~/.zshrc
Verify
After adding Neofetch to your shell configuration file and applying the changes, every time you open the terminal, Neofetch should run and display your system information.
Optional: Run Neofetch Only Once Per Session
If you prefer Neofetch to run only once per terminal session (which is often more desirable), you can modify the command to:
[ -z "$NEOFETCH_RUN" ] && neofetch && export NEOFETCH_RUN=1
or for Zsh:
if [ -z "$NEOFETCH_RUN" ]; then neofetch; export NEOFETCH_RUN=1; fi
Add this line to your .bashrc or .zshrc file instead of the simple neofetch command. This way, Neofetch will run only once per session.