Inititial commit

This commit is contained in:
Johannes Randerath 2024-05-06 21:04:37 +02:00
commit 16a147d988
7 changed files with 109 additions and 0 deletions

34
bashrc Normal file
View File

@ -0,0 +1,34 @@
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
if [ -d ~/.bashrc.d/l0/ ]; then
for rc in ~/.bashrc.d/l0/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
if [ -d ~/.bashrc.d/l1/ ]; then
for rc in ~/.bashrc.d/l1/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc

12
l1/aliasrc Normal file
View File

@ -0,0 +1,12 @@
alias ls='ls -lhia --color=auto'
alias vi=nvim
alias sudo="sudo "
alias grep='grep --color=auto'
alias tree='tree --dirsfirst -F'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias h=history
alias mkdir='mkdir -pv'

12
l1/calrc Normal file
View File

@ -0,0 +1,12 @@
alias jan='cal -m 01'
alias feb='cal -m 02'
alias mar='cal -m 03'
alias apr='cal -m 04'
alias may='cal -m 05'
alias jun='cal -m 06'
alias jul='cal -m 07'
alias aug='cal -m 08'
alias sep='cal -m 09'
alias oct='cal -m 10'
alias nov='cal -m 11'
alias dec='cal -m 12'

19
l1/colorrc Normal file
View File

@ -0,0 +1,19 @@
blk='\[\033[01;30m\]' # Black
red='\[\033[01;31m\]' # Red
grn='\[\033[01;32m\]' # Green
ylw='\[\033[01;33m\]' # Yellow
blu='\[\033[01;34m\]' # Blue
pur='\[\033[01;35m\]' # Purple
cyn='\[\033[01;36m\]' # Cyan
wht='\[\033[01;37m\]' # White
clr='\[\033[00m\]' # Reset
blk_fn='\033[01;30m' # Black
red_fn='\033[01;31m' # Red
grn_fn='\033[01;32m' # Green
ylw_fn='\033[01;33m' # Yellow
blu_fn='\033[01;34m' # Blue
pur_fn='\033[01;35m' # Purple
cyn_fn='\033[01;36m' # Cyan
wht_fn='\033[01;37m' # White
clr_fn='\033[00m' # Reset

1
l1/generalrc Normal file
View File

@ -0,0 +1 @@
set -o vi

6
l1/historyrc Normal file
View File

@ -0,0 +1,6 @@
HISTCONTROL=ignoredups
HISTSIZE=2000
HISTFILESIZE=2000
HISTTIMEFORMAT="%F %T "
shopt -s histappend

25
l1/promptrc Normal file
View File

@ -0,0 +1,25 @@
function is_git_repo() {
if [ -d .git ]; then
return 0;
fi
return 1;
}
function get_git_branch() {
if is_git_repo ; then
printf "($(git status 2> /dev/null | awk '/branch /{print $3; exit;}'))"
fi
}
function get_git_up2date() {
if is_git_repo ; then
if [ $(git status 2>/dev/null | awk '/nothing to commit, working tree clean/{print $1}') ]; then
printf ${grn_fn};
else
printf ${red_fn};
fi
fi
}
PS1=${ylw}'\u:'${blu}'\W '${wht}'$(get_git_branch)\[$(get_git_up2date)\]\$ '${clr}