Initial bash costumisation

This commit is contained in:
Dirk Alders 2020-01-26 17:20:02 +01:00
parent 68c23714a1
commit bd9bdbc97b
12 changed files with 90 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
enabled
# ---> Linux # ---> Linux
*~ *~

5
BASHRC_ADDON Normal file
View File

@ -0,0 +1,5 @@
# You may want to put all your additions into a folder file like
# ~/.bash, instead of adding them here directly.
for file in ~/.bash/enabled/*.sh; do
. $file
done

12
add Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
#
if [[ -e $1 ]]; then
target=`basename $1`
if [[ $target == "venv_prompt.sh" ]]; then
target="10_$target"
else
target="50_$target"
fi
cd enabled
ln -s ../$1 $target
fi

19
available/aliases.sh Normal file
View File

@ -0,0 +1,19 @@
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir -lh --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
function ssh() { /usr/bin/ssh $@ -X -t "tmux attach-session -t default_ssh || tmux new-session -s default_ssh"; }
alias dd='dd status=progress'
alias dd_status="watch -n5 'sudo kill -USR1 $(pgrep ^dd)'"

4
available/bin.sh Normal file
View File

@ -0,0 +1,4 @@
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

2
available/git_prompt.sh Normal file
View File

@ -0,0 +1,2 @@
PS1='$(giti)'"$PS1"
export PS1

3
available/neofetch.sh Normal file
View File

@ -0,0 +1,3 @@
neofetch

14
available/powerline.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# You need to install powerline and fonts-powerline
#
# You need to install powerline-gitstatus by sudo pip install powerline-gitstatus
# See also powerline.zip for the content in ~/config/powerline
if [ ! `which powerline-daemon` == "" ]; then
powerline-daemon -q
POWERLINE_BASH_SELECT=1
POWERLINE_BASH_CONTINUATION=1
. /usr/share/powerline/bindings/bash/powerline.sh
fi

BIN
available/powerline.tgz Normal file

Binary file not shown.

10
available/tmux_local.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#
if [ -z "$TMUX" ]; then
if tmux attach -t $(tmux ls | grep -v attached | head -1 | cut -f1 -d:) || tmux; then
exit
else
echo "Error while exicuting tmux. Check if tmux is installed"
fi
fi

19
available/venv_prompt.sh Normal file
View File

@ -0,0 +1,19 @@
function venv_status {
COLOR_WHITE="\033[00m"
COLOR_CYAN="\033[1;36m"
COLOR_RED="\033[1;31m"
COLOR_YELLOW="\033[1;33m"
COLOR_DARKYELLOW="\033[0;33m"
COLOR_GREEN="\033[1;32m"
COLOR_DARKGREEN="\033[0;32m"
COLOR_OCHRE="\033[38;5;95m"
if [[ ! $VIRTUAL_ENV == "" ]]; then
echo -e "$COLOR_DARKGREEN(🐍 `basename \"$VIRTUAL_ENV\"`)$COLOR_OCHRE "
fi
}
export VIRTUAL_ENV_DISABLE_PROMPT=1
PS1='$(venv_status)'"$PS1"
export PS1

0
enabled/.keep Normal file
View File