diff --git a/scripts/post_install/customizable_post_install.sh b/scripts/post_install/customizable_post_install.sh index 402db72..c881bc5 100644 --- a/scripts/post_install/customizable_post_install.sh +++ b/scripts/post_install/customizable_post_install.sh @@ -2788,16 +2788,23 @@ configure_fastfetch() { msg_ok "$(translate "Fastfetch configuration updated")" - sed -i '/fastfetch/d' ~/.bashrc ~/.profile /etc/profile + + sed -i '/fastfetch/d' ~/.bashrc ~/.profile /etc/profile 2>/dev/null rm -f /etc/update-motd.d/99-fastfetch + +if ! grep -q '# BEGIN FASTFETCH' ~/.bashrc; then cat << 'EOF' >> ~/.bashrc + +# BEGIN FASTFETCH # Run Fastfetch only in interactive sessions if [[ $- == *i* ]] && command -v fastfetch &>/dev/null; then clear fastfetch fi +# END FASTFETCH EOF +fi msg_ok "$(translate "Fastfetch will start automatically in the console")" msg_success "$(translate "Fastfetch installation and configuration completed")" diff --git a/scripts/post_install/uninstall-tools.sh b/scripts/post_install/uninstall-tools.sh index 7154d92..603de1d 100644 --- a/scripts/post_install/uninstall-tools.sh +++ b/scripts/post_install/uninstall-tools.sh @@ -59,6 +59,7 @@ uninstall_fastfetch() { rm -rf "$HOME/.config/fastfetch" rm -rf /usr/local/share/fastfetch sed -i '/fastfetch/d' "$HOME/.bashrc" "$HOME/.profile" /etc/profile 2>/dev/null + sed -i '/# BEGIN FASTFETCH/,/# END FASTFETCH/d' "$HOME/.bashrc" rm -f /etc/profile.d/fastfetch.sh /etc/update-motd.d/99-fastfetch dpkg -r fastfetch &>/dev/null