diff --git a/.gitignore b/.gitignore index c674098..8514093 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +enabled + # ---> Linux *~ diff --git a/BASHRC_ADDON b/BASHRC_ADDON new file mode 100644 index 0000000..cef36e3 --- /dev/null +++ b/BASHRC_ADDON @@ -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 diff --git a/add b/add new file mode 100755 index 0000000..b01f762 --- /dev/null +++ b/add @@ -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 \ No newline at end of file diff --git a/available/aliases.sh b/available/aliases.sh new file mode 100644 index 0000000..77458d7 --- /dev/null +++ b/available/aliases.sh @@ -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)'" \ No newline at end of file diff --git a/available/bin.sh b/available/bin.sh new file mode 100644 index 0000000..3d44fc0 --- /dev/null +++ b/available/bin.sh @@ -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 diff --git a/available/git_prompt.sh b/available/git_prompt.sh new file mode 100644 index 0000000..01cff55 --- /dev/null +++ b/available/git_prompt.sh @@ -0,0 +1,2 @@ +PS1='$(giti)'"$PS1" +export PS1 diff --git a/available/neofetch.sh b/available/neofetch.sh new file mode 100644 index 0000000..1b320af --- /dev/null +++ b/available/neofetch.sh @@ -0,0 +1,3 @@ +neofetch + + diff --git a/available/powerline.sh b/available/powerline.sh new file mode 100644 index 0000000..6e674ca --- /dev/null +++ b/available/powerline.sh @@ -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 diff --git a/available/powerline.tgz b/available/powerline.tgz new file mode 100644 index 0000000..cad819a Binary files /dev/null and b/available/powerline.tgz differ diff --git a/available/tmux_local.sh b/available/tmux_local.sh new file mode 100755 index 0000000..7c64ada --- /dev/null +++ b/available/tmux_local.sh @@ -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 + diff --git a/available/venv_prompt.sh b/available/venv_prompt.sh new file mode 100644 index 0000000..d847113 --- /dev/null +++ b/available/venv_prompt.sh @@ -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 + diff --git a/enabled/.keep b/enabled/.keep new file mode 100644 index 0000000..e69de29