Skip to content

Instantly share code, notes, and snippets.

@rubencaro
Last active March 16, 2019 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubencaro/19e4c3ac84a74dea40a20f01327a3f29 to your computer and use it in GitHub Desktop.
Save rubencaro/19e4c3ac84a74dea40a20f01327a3f29 to your computer and use it in GitHub Desktop.
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
export PATH=$HOME/.local/bin:$PATH
# fix too conservative defaults for colors
export TERM=xterm-256color
####### chivato del GIT
function parse_git_dirty {
git diff --quiet HEAD &>/dev/null
[[ $? == 1 ]] && echo "!"
}
git_branch() {
BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1)/")
echo "$BRANCH"
}
##### helpers de dot
#### ex: go_render myfile.dot &
function get_mtime {
ls -l --time-style=+%s "${1?}" | cut -d' ' -f6
}
function go_render {
dotfile="$1"
mtime=0
while true;
do
newtime=$(get_mtime "$dotfile")
test $mtime -ne $newtime && dot -O -Tpng $dotfile;
mtime=$newtime
sleep 1;
done;
}
#######
# joder ya con la dislexia !!
alias gti="git"
alias got="git"
alias tit="git" # yeah
# vim con poderes
alias vim="vimx"
alias whitenoise="play -q -c 2 --null synth 1:00:00 whitenoise bass 0 treble 0 reverb 0 tremolo 0.1 40 band 500 500"
#### prompt
PROMPT_DIRTRIM=2
bold=$(tput bold)
blink=$(tput blink)
brightwhite=$(tput setaf 15)
cyan=$(tput setaf 6)
brightred=$(tput setaf 9)
yellow=$(tput setaf 11)
orange=$(tput setaf 208)
gray=$(tput setaf 8)
reset=$(tput sgr0)
export PS1='\[$bold\]\[$gray\]\w\[$orange\]$(git_branch)\[$brightred\]\[$blink\]\[$bold\]$(parse_git_dirty)\[$reset\]\[$gray\] $(date +%M%S)\[$reset\] \$ '
### other stuff
export PROJECTS_PATH="$HOME/Documentos"
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
export ERL_AFLAGS="-kernel shell_history enabled"
# to allow qt5ct setup KDE apps settings
export QT_QPA_PLATFORMTHEME="qt5ct"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment