Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2017-05-03 16:10:13 +03:00
commit c78cb78ff0
72 changed files with 3570 additions and 0 deletions

44
homedir/.bashrc Normal file
View File

@@ -0,0 +1,44 @@
# vim: ft=sh
# Do nothing if not interactive
[[ "$PS1" ]] || return
# Modules
mpath=( $HOME/.config/bash.d )
function msg { printf '%s\n' "$*"; }
function err { printf '%s\n' "$*" >&2; }
function use {
while (( $# )); do
case $1 in
(-n) flag_nofail=1;;
(--) shift; break;;
(*) break;;
esac
shift
done
declare mname=$1
for p in "${mpath[@]}"; do
if [[ -f "$mpath/$mname" ]]; then
if source "$mpath/$mname"; then
msg "Loaded: $mname"
else
err "Something went wrong while loading $mname"
(( flag_nofail )) || return 1
fi
else
err "Module $mname not found"
(( flag_nofail )) || return 1
fi
done
return 0
}
use common
use colours
use config
use -n local
use prompt