Massive cleanup of my bash-config

The most important change is that I no longer create completions for fly
and kubectl automatically. Furthermore the automatic creation of a
cronjob to empty the downloads-folder is also gone. - These
funtionalities better fit the initial dev-machine setup, so I gonna move
them over to there soon.
This commit is contained in:
2025-09-17 23:29:08 +02:00
parent 0a307f6051
commit ff9dd116c2
3 changed files with 101 additions and 92 deletions

View File

@@ -1,24 +1,55 @@
# vim: ft=sh
# export everything
set -a
# freedesktop
# see: https://wiki.archlinux.org/index.php/XDG_Base_Directory
export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_HOME=$HOME/.local/share
export XDG_STATE_HOME=$HOME/.local/state
XDG_CONFIG_HOME=$HOME/.config
XDG_CACHE_HOME=$HOME/.cache
XDG_DATA_HOME=$HOME/.local/share
XDG_STATE_HOME=$HOME/.local/state
# set PATH so it includes user's private bin if it exists
[ -d "$HOME/.config/nvm/current/bin" ] && PATH="$HOME/.config/nvm/current/bin:$PATH"
[ -d "$HOME/.local/opt/go/bin" ] && PATH="$HOME/.local/opt/go/bin:$PATH"
[ -d "$HOME/.local/bin" ] && PATH="$HOME/.local/bin:$PATH"
test -d "$XDG_CONFIG_HOME" || mkdir -p -m 0700 "$XDG_CONFIG_HOME"
test -d "$XDG_CACHE_HOME" || mkdir -p -m 0700 "$XDG_CACHE_HOME"
test -d "$XDG_DATA_HOME" || mkdir -p -m 0700 "$XDG_DATA_HOME"
test -d "$XDG_STATE_HOME" || mkdir -p -m 0700 "$XDG_STATE_HOME"
## the following is macos specific foo
# just why!?!
[ -d "$HOME/Library/Python/3.9/bin" ] && PATH="$PATH:$HOME/Library/Python/3.9/bin"
# adjust the PATH to include .local/bin
case "$PATH" in *"$HOME/.local/bin"*) ;; *) PATH="$HOME/.local/bin:$PATH";; esac
# docker desktop...
[ -d "/usr/local/bin" ] && PATH="/usr/local/bin:$PATH"
# ignore bash-deprecation on macos
BASH_SILENCE_DEPRECATION_WARNING=1
# brew...
[ -f "/opt/homebrew/bin/brew" ] && eval "$(/opt/homebrew/bin/brew shellenv)"
# configure history
HISTTIMEFORMAT="%d/%m/%y %T "
HISTSIZE=40000
HISTFILESIZE=50000
HISTFILE="$XDG_STATE_HOME/shell-history.log"
HISTCONTROL=ignorespace:ignoredups
# as far as I remember only needed for liquibase...
[ -d "/opt/homebrew/opt/libpg/bin" ] && export PATH="/opt/homebrew/opt/libpg/bin:$PATH"
# configure less so it will display pdf and stuff "raw" (needs lesspipe installed)
LESS='-R'
LESSOPEN='|lesspipe %s'
# git prompt
GIT_PS1_SHOWCOLORHINTS=1
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM='auto'
# arbitrary variables for required by different tools
# nvm to use different node.js versions
NVM_DIR="$XDG_CONFIG_HOME/nvm"
# sdkman to use different java tools in different versions easily
SDKMAN_DIR="$XDG_CONFIG_HOME/sdkman"
# homebrew is complicated as shit, lucky me only relevant on macos
test `uname` = "Darwin" && test `uname -m` = "arm64" && HOMEBREW_PREFIX=/opt/homebrew
test `uname` = "Darwin" && test ! `uname -m` = "arm64" && HOMEBREW_PREFIX=/usr/local
# add homebrew to path
case "$PATH" in *"$HOMEBREW_PREFIX/bin"*) ;; *) PATH="$HOMEBREW_PREFIX/bin:$PATH";; esac
# stop exporting everything
set +a