1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | # ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
# Add to history instead of overriding it
shopt -s histappend
# History lenght
HISTSIZE=1000
HISTFILESIZE=2000
# Window size sanity check
shopt -s checkwinsize
# User/root variables definition
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# Colored XTERM promp
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# Colored prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi
# Prompt
if [ -n "$SSH_CONNECTION" ]; then
export PS1="\[$(tput setaf 1)\]┌─╼ \[$(tput setaf 7)\][\w]\n\[$(tput setaf 1)\]\$(if [[ \$? == 0 ]]; then echo \"\[$(tput setaf 1)\]└────╼ \[$(tput setaf 7)\][ssh]\"; else echo \"\[$(tput setaf 1)\]└╼ \[$(tput setaf 7)\][ssh]\"; fi) \[$(tput setaf 7)\]"
else
export PS1="\[$(tput setaf 1)\]┌─╼ \[$(tput setaf 7)\][\w]\n\[$(tput setaf 1)\]\$(if [[ \$? == 0 ]]; then echo \"\[$(tput setaf 1)\]└────╼\"; else echo \"\[$(tput setaf 1)\]└╼\"; fi) \[$(tput setaf 7)\]"
fi
trap 'echo -ne "\e[0m"' DEBUG
# I this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u: \w\a\]$PS1"
;;
*)
;;
esac
# Color support
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
fi
# Alias definitions.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Auto-completion
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Advanced directory creation
function mkcd {
if [ ! -n "$1" ]; then
echo "Entrez un nom pour ce dossier"
elif [ -d $1 ]; then
echo "\`$1' existe déjà"
else
mkdir $1 && cd $1
fi
}
# Go back with ..
b() {
str=""
count=0
while [ "$count" -lt "$1" ];
do
str=$str"../"
let count=count+1
done
cd $str
}
# Color man pages
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
# Auto cd
shopt -s autocd
# ls after a cd
function cd()
{
builtin cd "$*" && ls
}
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
|
x
randalltux said about 11 years ago
Whats font ?
Graawr said about 11 years ago
It’s Ohsnap, from the AUR.
randalltux said about 11 years ago
Can i get thats fonts for Debian base?
Graawr said about 11 years ago
Yes, of course, that’s just a font, it’s “universal”. Download the tarball directly from the AUR website and then you can just copy/paste the extracted font in your fonts folder.
Remember to activate the bitmaps fonts rendering if you haven’t already done it, otherwise Xorg won’t accept it.
EDIT: Here’s a direct link to the font (the AUR tarball doesn’t actually include it, it just downloads it from sourceforge): http://sourceforge.net/projects/osnapfont/
edited about 11 years ago
randalltux said about 11 years ago
Thanks pal :)
kyzys said about 11 years ago
Thanks for this, I adopted it and modified it a little bit for zsh and it looks great.
Graawr said about 11 years ago
Oh, great :)
Could you show your zsh version, please? I feel like using zsh over bash but I’m kind of baffled by the amount of config needed, so if you already converted the one I want to use… :D
kyzys said about 11 years ago
Yep here it is: http://txtup.co/TPmAx I changed the color from red to blue and have a time prompt on the right that is green on a successful command and red on a non successful. Most, if not all of your other options transfer over directly. It’s actually very easy to configure and I highly recommend it, suffix aliases are bomb. Edit; that goes in your .zshrc if its local.
edited about 11 years ago
Graawr said about 11 years ago
Thanks a lot, I'l dive into that :)