# ~/.bashrc: executed by bash(1) for non-login shells. source /etc/profile ############################################################ SSH_ENV="$HOME/.ssh/environment" function start_agent { echo "Initialising new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" echo succeeded chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null /usr/bin/ssh-add; } # Source SSH settings, if applicable function sshagent { if [ -f "${SSH_ENV}" ]; then . "${SSH_ENV}" > /dev/null #ps ${SSH_AGENT_PID} doesn't work under cywgin ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { start_agent; } else start_agent; fi } ############################################################ #tempraer ############################################################ export GDFONTPATH=/usr/share/fonts/corefonts/ ############################################################ export CFLAGS="-march=athlon-xp" export CXXFLAGS="${CFLAGS}" export MAIL=/home/calmar/.mail/inbox export MAILCHECK=5 export HISTSIZE=8000 export HISTSIZE=6000 export EDITOR=vim export LANG=en_US.UTF-8 export TERM='xterm-256color' #export TERM='rxvt-256color' export GIT_AUTHOR_NAME="marco candrian" export GIT_AUTHOR_EMAIL="mac@calmar.ws" export HISTCONTROL=ignoredups export PATH=~/bin:"${PATH}" export PATH=/opt/android-sdk-update-manager/tools/:"${PATH}" export PATH=/opt/android-sdk-update-manager/platform-tools/:"${PATH}" #export XDG_CONFIG_HOME=/home/calmar/.config/ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" avidemux (){ command avidemux2_qt4 "$@"; } colordiff () { command colordiff < "$@" | less -r; } cp () { command cp -i "$@"; } df () { command df -h $@; } #elinks () { if [[ -z $XTERM ]]; then command elinks -config-file elinks_t.conf; else command elinks; fi } fics () { command xboard -xautoflip -thinking -highlightLastMove ON -ics -icshost freechess.org -fcp crafty -size huge; } ff () { command find . -iname "*${1}*"; } g () { gvim $@; } #git-send-email-awesome () { command git-send-email --envelope-sender "mac@calmar.ws" --to candrimac@gmx.net "$@"; } git-send-email-awesome () { command git-send-email --envelope-sender "mac@calmar.ws" --to awesome-devel@naquadah.org "$@"; } git-format-patch-awesome () { command git-format-patch --attach "$@"; } gma () { mkup_priv; cd /home/calmar/work/golf/; vim gma.txt; read -p "mkdown_all_tc (Y/n):" a; [[ $a != "n" ]] && cd && mkdown_all_tc; } rcl () { vim /home/calmar/.config/awesome/rc.lua; } datacoll () { mkup_priv; vim /home/calmar/work/calmar.datacoll; cd; read -p "mkdown_all_tc (Y/n):" a; [[ $a != "n" ]] && mkdown_all_tc; } gqview () { command gqview "$@"; } indent (){ command indent -kr -nut -l80 "$@"; } la () { ls -A -all -h "$@"; } ll () { ls -l -h "$@"; } l () { ls -CFH "$@"; } mv () { command mv -i "$@"; } feh () { command feh -d "$@"; } ss() { "$@" | less; } vv () { "$@" | /home/calmar/packets/vimbuild/vim71/runtime/macros/less.sh; } v () { vim "$@"; } weechat () { command /usr/local/bin/weechat-curses "$@"; } nb () { TERM=xterm command newsbeuter "$@"; } sshsilence () { command ssh calmar@silenceisdefeat.org; } mklatexclean () { rm -v *.dvi *.log *.pdf *.aux; } amutt () { command urxvt -tn "${TERM}" -e mutt; } aweechat () { command urxvt -tn "${TERM}" -e weechat-curses; } arestart () { command /sbin/shutdown -r now; } ashutdown () { command /sbin/shutdown -h now; } xmc () { command urxvt -tn "${TERM}" -e mc; } rcpsilence () { command rcp "$@" calmar@silenceisdefeat.org: ; } sshawesome () { command ssh calmar@git.naquadah.org; } rcpawesome () { command rcp "$@" calmar@git.naquadah.org: ; } del () { command /home/calmar/bin/mv_trash "$@"; } ffox2 () { command /home/calmar/packets/ffox2/firefox/firefox -P ffox2 "$@"; } cxboard () { command xboard -xautoflip -highlightLastMove ON -thinking -fcp crafty -size huge; } xdvi (){ command xdvi -s 5 "$@"; } gopackages.use () { sudo vim /etc/portage/package.use; } gomake.conf () { sudo vim /etc/make.conf; } gouse.desc () { grep "$*" /usr/portage/profiles/use.desc; } # mplayer () { command mplayer -loop 0 "$@"; } # display () { command display -quality 100 "$@"; } cd() { pushd "${@:-$HOME}" >/dev/null ls -shF; } c () { eval cd +${1}; } d (){ dirs -v; } pu (){ pushd; } po (){ popd; } cdx(){ popd "$@" >/dev/null ls -hF; } kk (){ kill $(pgrep ${1}); } cpcd(){ tmp=$* dest=${tmp##* } files=${tmp% *} cp $files $dest cd $dest } mvcd(){ tmp=$* dest=${tmp##* } files=${tmp% *} mv $files $dest cd $dest } pskill() { local pid exec 3<&0 ps ax | gawk '{ print $1, $5 }' | grep $1 | grep -v grep | \ while read line; do pid=$(echo $line | gawk '{ print $1 }') echo -n "$(echo $line | gawk '{ print $1, " " , $2 }')" read -p " Killing (*/n): " <&3 case $REPLY in [nN] ) break ;; * ) kill -9 $pid sleep 1 if ps ax | grep -e "^ *${pid}" > /dev/null ; then echo "sorry, process is still there" else echo " process got slaughtered" fi ;; esac done exec 0<&3 exec 3>&- } # Midnight Commander chdir enhancement if [ -f /usr/share/mc/mc.gentoo ]; then . /usr/share/mc/mc.gentoo fi [[ -f /etc/profile.d/bash-completion ]] && source /etc/profile.d/bash-completion # startx #if ! pgrep 'xinit' >/dev/null && ! pgrep 'screen' >/dev/null; then if [[ "$(tty)" == "/dev/tty1" ]] ; then echo " for no X loading" var=""; i=2 while [[ $(( i-- )) -gt 1 ]]; do echo -n "$i..." read -t 1 bogus && var="noX" && break done if ! [[ $var == "noX" ]]; then echo "starting X"; startx -- -dpi 108 -br ; fi fi ################################################################################ ## end export PS1='$(E=$?; test $E -eq 0 || echo -n "\[\033[0;91m\][$E]\[\033[0m\]")\u@\h:$(P=${PWD/#$HOME/\~}; if [ ${#P} -lt 26 ]; then echo "\[\033[0;90m\]$P"; else echo "\[\033[0;90m\]...${P: -22}";fi)\[\033[1;32m\]\$\[\033[0m\] ' ## possible colors ## \[\033[1; \] ## 0, 1, 22, 4, 24, 5, 25, 7, 27 -> default, bold, not bold, underlined, not underlined, ## blinking and not blinking, invers, not invers. ## 0m-default #for i in {1..7} {30..47} {90..107}; do # printf '\033[0;%sm %02s\033[0m \n' $i $i #done # if [ "$TERM" != "dumb" ]; then # eval $(dircolors -b /etc/dircolors.conf) # ls () { command ls --color=auto "$@"; } # fi #_mpdadd_complete_func () #{ #cur="${COMP_WORDS[COMP_CWORD]}" #first=${COMP_WORDS[1]} #hold=""; ## add more escape stuff as needed: #scrub='s/\([\\\>\\\<\\\(\\\)\\\";]\)/\\\1/g'; #case "$first" in #add) #hold=`mpc tab ${cur}`; #COMPREPLY=($(compgen -W "${hold}" | sed "$scrub")) #return 0 #;; #play|del|move) #hold=`mpc playlist | sed 's/\#\([[:digit:]]\+\).*/\1/g'` # | grep "^${cur}"` #COMPREPLY=($(compgen -W "${hold}" "${cur}")) #return 0 #;; ## TODO add trailing 's' for seconds in seek (total song time needed) #seek|volume) #COMPREPLY=($(compgen -W "`seq 0 100; seq -f +%g 0 100; seq -f -%g 0 100`" "${cur}")) #return 0 #;; ## TODO get total song time and use that as a limit #crossfade) #COMPREPLY=($(compgen -W "`seq 0 99`" "${cur}")) #return 0 #;; #ls) #if [ "x$cur" = "x" ]; then #hold=`mpc ls`; #else #hold=`mpc lstab ${cur}`; #fi #COMPREPLY=($(compgen -W "${hold}" | sed "$scrub")) #return 0 #;; #search) #COMPREPLY=($(compgen -W "album artist title filename" "${cur}")) #return 0 #;; #load|save|rm) #if [ "x$cur" = "x" ]; then #hold=`mpc lsplaylists`; #else #hold=`mpc loadtab ${cur}`; #fi #COMPREPLY=($(compgen -W "${hold}" | sed "$scrub")) #return 0 #;; #repeat|random) #COMPREPLY=($(compgen -W "0 1 true false yes no on off" "${cur}")) #return 0 #;; #*) #hold=`mpc help 2>&1 | grep "^mpc [a-z]\+ " | awk '{print $2}'`; #COMPREPLY=($(compgen -W "${hold} status" ${cur})) #return 0 #;; #esac #} #complete -F _mpdadd_complete_func mpc