From e552f45e554ba9fe7b345d30328dfb435dafcdb4 Mon Sep 17 00:00:00 2001 From: poprhythm Date: Tue, 24 Feb 2026 02:48:52 +0000 Subject: [PATCH] .bashrc improvements --- bash/.bashrc | 179 ----------------------------------------------- bash/.bashrc.omb | 53 ++++++++++++++ setup.sh | 50 +++++++++++-- ssh/.ssh/config | 2 +- 4 files changed, 98 insertions(+), 186 deletions(-) delete mode 100644 bash/.bashrc create mode 100644 bash/.bashrc.omb diff --git a/bash/.bashrc b/bash/.bashrc deleted file mode 100644 index c140125..0000000 --- a/bash/.bashrc +++ /dev/null @@ -1,179 +0,0 @@ -# Enable the subsequent settings only in interactive sessions -case $- in - *i*) ;; - *) return;; -esac - -# Path to your oh-my-bash installation. -export OSH='/home/poprhythm/.oh-my-bash' - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-bash is loaded. -OSH_THEME="agnoster" - -# If you set OSH_THEME to "random", you can ignore themes you don't like. -# OMB_THEME_RANDOM_IGNORED=("powerbash10k" "wanelo") -# You can also specify the list from which a theme is randomly selected: -# OMB_THEME_RANDOM_CANDIDATES=("font" "powerline-light" "minimal") - -# Uncomment the following line to use case-sensitive completion. -# OMB_CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# OMB_HYPHEN_SENSITIVE="false" - -# Uncomment the following line to disable bi-weekly auto-update checks. -# DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_OSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you don't want the repository to be considered dirty -# if there are untracked files. -# SCM_GIT_DISABLE_UNTRACKED_DIRTY="true" - -# Uncomment the following line if you want to completely ignore the presence -# of untracked files in the repository. -# SCM_GIT_IGNORE_UNTRACKED="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. One of the following values can -# be used to specify the timestamp format. -# * 'mm/dd/yyyy' # mm/dd/yyyy + time -# * 'dd.mm.yyyy' # dd.mm.yyyy + time -# * 'yyyy-mm-dd' # yyyy-mm-dd + time -# * '[mm/dd/yyyy]' # [mm/dd/yyyy] + [time] with colors -# * '[dd.mm.yyyy]' # [dd.mm.yyyy] + [time] with colors -# * '[yyyy-mm-dd]' # [yyyy-mm-dd] + [time] with colors -# If not set, the default value is 'yyyy-mm-dd'. -# HIST_STAMPS='yyyy-mm-dd' - -# Uncomment the following line if you do not want OMB to overwrite the existing -# aliases by the default OMB aliases defined in lib/*.sh -# OMB_DEFAULT_ALIASES="check" - -# Would you like to use another custom folder than $OSH/custom? -# OSH_CUSTOM=/path/to/new-custom-folder - -# To disable the uses of "sudo" by oh-my-bash, please set "false" to -# this variable. The default behavior for the empty value is "true". -OMB_USE_SUDO=true - -# To enable/disable display of Python virtualenv and condaenv -# OMB_PROMPT_SHOW_PYTHON_VENV=true # enable -# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable - -# To enable/disable Spack environment information -# OMB_PROMPT_SHOW_SPACK_ENV=true # enable -# OMB_PROMPT_SHOW_SPACK_ENV=false # disable - -# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*) -# Custom completions may be added to ~/.oh-my-bash/custom/completions/ -# Example format: completions=(ssh git bundler gem pip pip3) -# Add wisely, as too many completions slow down shell startup. -completions=( - git - composer - ssh -) - -# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*) -# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/ -# Example format: aliases=(vagrant composer git-avh) -# Add wisely, as too many aliases slow down shell startup. -aliases=( - general -) - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=( - git - bashmarks -) - -# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) -# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: -# if [ "$DISPLAY" ] || [ "$SSH" ]; then -# plugins+=(tmux-autoattach) -# fi - -# If you want to reduce the initialization cost of the "tput" command to -# initialize color escape sequences, you can uncomment the following setting. -# This disables the use of the "tput" command, and the escape sequences are -# initialized to be the ANSI version: -# -#OMB_TERM_USE_TPUT=no - -source "$OSH"/oh-my-bash.sh - -# User configuration -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/rsa_id" - -# Set personal aliases, overriding those provided by oh-my-bash libs, -# plugins, and themes. Aliases can be placed here, though oh-my-bash -# users are encouraged to define aliases within the OSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias bashconfig="mate ~/.bashrc" -# alias ohmybash="mate ~/.oh-my-bash" -export PATH="$HOME/.local/bin:$PATH" - -# Enable color support for various commands -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - # Use eza (modern ls replacement) with colors and directory grouping - alias ls='eza -l --color=always --group-directories-first' - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# Additional ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# nvim alias -alias vim=nvim - -# Run fastfetch on terminal startup -fastfetch diff --git a/bash/.bashrc.omb b/bash/.bashrc.omb new file mode 100644 index 0000000..6c4a378 --- /dev/null +++ b/bash/.bashrc.omb @@ -0,0 +1,53 @@ +# oh-my-bash configuration +if [ -d "$HOME/.oh-my-bash" ]; then + export OSH="$HOME/.oh-my-bash" + + OSH_THEME="agnoster" + OMB_USE_SUDO=true + + completions=( + git + composer + ssh + ) + + aliases=( + general + ) + + plugins=( + git + bashmarks + ) + + source "$OSH/oh-my-bash.sh" +fi + +# PATH +export PATH="$HOME/.local/bin:$PATH" + +# Color support +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# ls — use eza if available, fallback to ls +if command -v eza &>/dev/null; then + alias ls='eza -l --color=always --group-directories-first' +fi +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# nvim alias +if command -v nvim &>/dev/null; then + alias vim=nvim +fi + +# Run fastfetch on terminal startup +if command -v fastfetch &>/dev/null; then + fastfetch +fi diff --git a/setup.sh b/setup.sh index 6fc9d03..cbad8e5 100755 --- a/setup.sh +++ b/setup.sh @@ -4,14 +4,52 @@ set -e DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# Packages to stow -PACKAGES=(bash kitty fastfetch ssh) - echo "Setting up dotfiles from $DOTFILES_DIR" -for pkg in "${PACKAGES[@]}"; do - echo "Stowing $pkg..." +stow_pkg() { + local pkg="$1" stow -v -d "$DOTFILES_DIR" -t "$HOME" "$pkg" -done +} + +ensure_sourced() { + local file="$1" + local bashrc="$HOME/.bashrc" + local source_line="[ -f \"$file\" ] && source \"$file\"" + + if [ ! -f "$bashrc" ]; then + echo "WARNING: ~/.bashrc not found, skipping source injection for $file" + return + fi + + if grep -qF "$file" "$bashrc"; then + echo "OK: $file already sourced in ~/.bashrc" + else + echo "" >> "$bashrc" + echo "# Added by dotfiles setup" >> "$bashrc" + echo "$source_line" >> "$bashrc" + echo "ADDED: source $file to ~/.bashrc" + fi +} + +# ssh — always available +stow_pkg ssh + +# bash — stow dotfiles, then ensure ~/.bashrc sources them +stow_pkg bash +ensure_sourced "$HOME/.bashrc.omb" + +# kitty +if command -v kitty &>/dev/null; then + stow_pkg kitty +else + echo "SKIP: kitty (not installed)" +fi + +# fastfetch +if command -v fastfetch &>/dev/null; then + stow_pkg fastfetch +else + echo "SKIP: fastfetch (not installed)" +fi echo "Done!" diff --git a/ssh/.ssh/config b/ssh/.ssh/config index 6203566..0ea56be 100644 --- a/ssh/.ssh/config +++ b/ssh/.ssh/config @@ -1,4 +1,4 @@ Host gitea.kolpacksoftware.com - HostName 192.168.1.67 + HostName 127.0.0.1 Port 222 User git