From 009385e3fdedb73bcbe6a046dae2583ab46feb11 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Wed, 17 Dec 2025 23:17:42 +0100 Subject: [PATCH] Fix Bash configuration --- bash/.bashrc | 20 ++++++++++---------- bash/{.profile.d => .bashrc.d}/cargo.sh | 0 bash/{.profile.d => .bashrc.d}/homebrew.sh | 0 bash/{.profile.d => .bashrc.d}/java.sh | 0 bash/{.profile.d => .bashrc.d}/mise.sh | 0 bash/.bashrc.d/starship.sh | 6 ++++++ bash/.profile | 5 +---- bash/.profile.d/tmux.sh | 5 ----- 8 files changed, 17 insertions(+), 19 deletions(-) rename bash/{.profile.d => .bashrc.d}/cargo.sh (100%) rename bash/{.profile.d => .bashrc.d}/homebrew.sh (100%) rename bash/{.profile.d => .bashrc.d}/java.sh (100%) rename bash/{.profile.d => .bashrc.d}/mise.sh (100%) create mode 100644 bash/.bashrc.d/starship.sh delete mode 100755 bash/.profile.d/tmux.sh diff --git a/bash/.bashrc b/bash/.bashrc index 7ee516c..649b2bd 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -1,7 +1,7 @@ # Enable the subsequent settings only in interactive sessions case $- in *i*) ;; - *) return;; + *) return ;; esac # Path to your oh-my-bash installation. @@ -174,17 +174,17 @@ alias egrep='grep -E' alias fgrep='grep -F' # Other aliases -alias paths='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths +alias paths='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths alias userlist="cut -d: -f1 /etc/passwd | sort" alias ip='ip -color' alias stow='stow -d $DOTFILES ' -# Starship prompt -if command -v starship > /dev/null 2>&1; then - eval "$(starship init bash)" -fi - -# Load Mise en dev -if command -v mise > /dev/null 2>&1; then - eval "$(mise activate bash)" +# User specific aliases and functions +if [ -d ~/.bashrc.d ]; then + for rc in ~/.bashrc.d/*; do + if [ -f "$rc" ]; then + . "$rc" + fi + done fi +unset rc diff --git a/bash/.profile.d/cargo.sh b/bash/.bashrc.d/cargo.sh similarity index 100% rename from bash/.profile.d/cargo.sh rename to bash/.bashrc.d/cargo.sh diff --git a/bash/.profile.d/homebrew.sh b/bash/.bashrc.d/homebrew.sh similarity index 100% rename from bash/.profile.d/homebrew.sh rename to bash/.bashrc.d/homebrew.sh diff --git a/bash/.profile.d/java.sh b/bash/.bashrc.d/java.sh similarity index 100% rename from bash/.profile.d/java.sh rename to bash/.bashrc.d/java.sh diff --git a/bash/.profile.d/mise.sh b/bash/.bashrc.d/mise.sh similarity index 100% rename from bash/.profile.d/mise.sh rename to bash/.bashrc.d/mise.sh diff --git a/bash/.bashrc.d/starship.sh b/bash/.bashrc.d/starship.sh new file mode 100644 index 0000000..8c0ee30 --- /dev/null +++ b/bash/.bashrc.d/starship.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Starship prompt +if command -v starship >/dev/null 2>&1; then + eval "$(starship init bash)" +fi diff --git a/bash/.profile b/bash/.profile index 4ca3a61..3bef0e7 100644 --- a/bash/.profile +++ b/bash/.profile @@ -46,11 +46,8 @@ appendpath() { esac } +appendpath "/home/linuxbrew/.linuxbrew/bin" appendpath "$HOME/.local/bin" appendpath "$GOBIN" appendpath "$HOME/.cargo/bin" unset appendpath - -source "$HOME/.profile.d/homebrew.sh" -source "$HOME/.profile.d/mise.sh" -source "$HOME/.profile.d/java.sh" diff --git a/bash/.profile.d/tmux.sh b/bash/.profile.d/tmux.sh deleted file mode 100755 index bef9bbd..0000000 --- a/bash/.profile.d/tmux.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env zsh - -if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then - tmux attach-session -t default || tmux new-session -s default -fi