summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-11-25 19:20:11 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-11-25 19:20:11 +0100
commit2ab286282a5a7aac8c972d9c46dfba229d0af4d4 (patch)
tree8f7e3569d9e43719cda7d3b46a2338e57552da50 /bashrc
parentc312167930809f102752f04a349ae51fd2a09b03 (diff)
downloadbin-2ab286282a5a7aac8c972d9c46dfba229d0af4d4.zip
bin-2ab286282a5a7aac8c972d9c46dfba229d0af4d4.tar.gz
clean bashrc
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc80
1 files changed, 5 insertions, 75 deletions
diff --git a/bashrc b/bashrc
index a9edcb3..a22db4f 100644
--- a/bashrc
+++ b/bashrc
@@ -5,22 +5,19 @@ function parse_git_branch()
{
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
-if [ `whoami` = "root" ]
-then
- export PS1='\[\033[01;47;31m\]\h\[\033[40;31m\] \u \[\033[37m\]\W \$ \[\033[00m\]'
-else
- export PS1='\[\033[01;33m\]\u\[\033[01;35m\]@\[\033[00;31m\]\h\[\033[00m\]:\[\033[0;33m\] \W \[\033[01;35m\]$(parse_git_branch)\[\033[0;33m\] \[\033[0m\]\$ '
-fi
+export PS1='\[\033[01;33m\]\u\[\033[01;35m\]@\[\033[00;31m\]\h\[\033[00m\]:\[\033[0;33m\] \W \[\033[01;35m\]$(parse_git_branch)\[\033[0;33m\] \[\033[0m\]\$ '
unset PROMPT_COMMAND
-# TERM
+# COLORS
if [ -r /usr/share/terminfo/x/xterm-256color ]
then
export TERM='xterm-256color'
else
export TERM='xterm-color'
fi
-eval $(dircolors ~/.dir_colors)
+[ -r ~/.dir_colorss ] && eval $(dircolors ~/.dir_colors)
+alias ls="ls --color=auto -F -b -T 0"
+alias ll="ls -l --color=auto -F -b -T 0"
# BELL
[ ! -z $DISPLAY ] && xset b 0
@@ -28,57 +25,14 @@ eval $(dircolors ~/.dir_colors)
# VIMMODE
set -o vi
-shopt -s autocd
-
# DPI
export QT_FONT_DPI=100
-# COLORLS
-OSNAME=`uname`
-case $OSNAME in
- Linux)
- alias ls="ls --color=auto -F -b -T 0"
- alias ll="ls -l --color=auto -F -b -T 0"
- ;;
- FreeBSD)
- LSCOLOR="3x5x2x3x1x464301060203"
- alias ls="ls -GF"
- export LSCOLORS
- ;;
- OpenBSD)
- alias ls="colorls -F -G"
- export PKG_PATH="ftp://mirror.switch.ch/mirror/OpenBSD/4.0/packages/i386/"
- ;;
-esac
-
# ENV
-function set_if_not_in()
-{
- env_var=$1
- arg=$2
- IFS=":";
- for p in ${!env_var}; do if [ $p == $arg ]; then IFS=" "; return 0; fi done
- IFS=" ";
- export ${env_var}=$arg:${!env_var}
-}
-
-function export_if_exists()
-{
- _TMP=`which $2 2>/dev/null`
- [ -z ${_TMP} ] && _TMP=$3
- eval "export $1=$_TMP"
-}
-
-[ -r /etc/profile.d/undistract-me.sh ] && source /etc/profile.d/undistract-me.sh
-
-# prepend ~/bin to path if not already there
HOME_=$(readlink -f ${HOME%/})
export PATH=${HOME_}/bin:${PATH#${HOME_}/bin:}
-export_if_exists 'PAGER' 'less' '/bin/more'
export EDITOR=nvim
-# RUBY
export GEM_HOME="${HOME_}/.gem/ruby/3.0.0"
-set_if_not_in 'PATH' ${GEM_HOME}/bin
# catch and eval dmalloc output
#function dmalloc { eval `command dmalloc -b $*`; }
@@ -112,30 +66,6 @@ function xcon () { # external established connections
| netcat whois.cymru.com 43 | grep -v "AS Name" | sort -t'|' -k3
}
-function xtract() {
- if [ -f "$1" ] ; then
- case "$1" in
- *.tar.bz2) tar xvjf "$1" ;;
- *.tar.gz) tar xvzf "$1" ;;
- *.bz2) bunzip2 "$1" ;;
- *.rar) unrar x "$1" ;;
- *.gz) gunzip "$1" ;;
- *.tar) tar xvf "$1" ;;
- *.tbz2) tar xvjf "$1" ;;
- *.tgz) tar xvzf "$1" ;;
- *.zip) unzip "$1" ;;
- *.ZIP) unzip "$1" ;;
- *.pax) cat "$1" | pax -r ;;
- *.pax.Z) uncompress "$1" —stdout | pax -r ;;
- *.Z) uncompress "$1" ;;
- *.7z) 7z x "$1" ;;
- *) echo "don't know how to extract '$1'..." ;;
- esac
- else
- echo "extract: error: $1 is not valid"
- fi
-}
-
# SSH
ssh-add -l &>/dev/null
if [ $? -ne 0 ]