From 6cc91238071521e673bb6a2715e4213c5305854a Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Tue, 10 Mar 2026 17:09:39 +0100 Subject: [PATCH] Move inline .bashrc config into modular .bash.d/ scripts Extracted history, shell options, dircolors, rbenv, ~/.local/bin PATH, and Maestro PATH from ~/.bashrc into dedicated .bash.d/ files, reducing .bashrc from 126 lines to a minimal 23-line loader. New files: - 10-local-path: ~/.local/bin via path_prepend - 10-maestro-path: ~/.maestro/bin via path_append - 20-rbenv: rbenv init with existence guard - 30-shell-options: history, checkwinsize, dircolors Co-Authored-By: Claude Opus 4.6 --- 10-bun-path | 2 +- 10-local-path | 3 +++ 10-maestro-path | 3 +++ 20-rbenv | 5 +++++ 30-shell-options | 21 +++++++++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 10-local-path create mode 100755 10-maestro-path create mode 100755 20-rbenv create mode 100755 30-shell-options diff --git a/10-bun-path b/10-bun-path index f582a77..940d56a 100755 --- a/10-bun-path +++ b/10-bun-path @@ -1,3 +1,3 @@ # shellcheck shell=bash -# Add Bun (a fast JavaScript runtime and package manager) to PATH +# Bun — fast JavaScript runtime and package manager path_append "$HOME/.bun/bin" diff --git a/10-local-path b/10-local-path new file mode 100755 index 0000000..ae25591 --- /dev/null +++ b/10-local-path @@ -0,0 +1,3 @@ +# shellcheck shell=bash +# Add ~/.local/bin to PATH (pip, pipx, user-installed tools) +path_prepend "$HOME/.local/bin" diff --git a/10-maestro-path b/10-maestro-path new file mode 100755 index 0000000..cda345c --- /dev/null +++ b/10-maestro-path @@ -0,0 +1,3 @@ +# shellcheck shell=bash +# Add Maestro (mobile UI testing framework) to PATH +path_append "$HOME/.maestro/bin" diff --git a/20-rbenv b/20-rbenv new file mode 100755 index 0000000..484bf98 --- /dev/null +++ b/20-rbenv @@ -0,0 +1,5 @@ +# shellcheck shell=bash +# Initialize rbenv (Ruby version manager) +if [[ -x "$HOME/.rbenv/bin/rbenv" ]]; then + eval "$("$HOME/.rbenv/bin/rbenv" init - --no-rehash bash)" +fi diff --git a/30-shell-options b/30-shell-options new file mode 100755 index 0000000..a1c31ec --- /dev/null +++ b/30-shell-options @@ -0,0 +1,21 @@ +# shellcheck shell=bash +# Shell options: history, window size, and color support + +# History +HISTCONTROL=ignoredups +shopt -s histappend +HISTSIZE=1000 +HISTFILESIZE=2000 + +# Update LINES and COLUMNS after each command +shopt -s checkwinsize + +# Enable color support for ls +if command -v dircolors &>/dev/null; then + if [[ -r ~/.dircolors ]]; then + eval "$(dircolors -b ~/.dircolors)" + else + eval "$(dircolors -b)" + fi + alias ls='ls --color=auto' +fi