dotfiles

A steaming hot pile of sh...ell scripts and configuration files.
git clone https://kaka.farm/~git/dotfiles
Log | Files | Refs

.bash_aliases (1958B)


      1 #!/bin/bash
      2 
      3 # enable color support of ls and also add handy aliases
      4 if [ -x /usr/bin/dircolors ]; then
      5     test -r ~/.dircolors
      6     if [[ $? == 0 ]]; then
      7         eval "$(dircolors -b ~/.dircolors)";
      8     else
      9         eval "$(dircolors -b)"
     10     fi
     11     alias ls='ls --color=auto'
     12     #alias dir='dir --color=auto'
     13     #alias vdir='vdir --color=auto'
     14 
     15     alias grep='grep --color=auto'
     16     alias fgrep='fgrep --color=auto'
     17     alias egrep='egrep --color=auto'
     18 fi
     19 
     20 # some more ls aliases
     21 alias ll='ls -alF'
     22 alias la='ls -A'
     23 alias l='ls -CF'
     24 
     25 # Add an "alert" alias for long running commands.  Use like so:
     26 #   sleep 10; alert
     27 alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
     28 
     29 alias g=git
     30 alias gl='g l'
     31 alias gs='g s'
     32 alias gc='g c'
     33 alias gd='g d'
     34 
     35 alias e="emacsclient -a= -c"
     36 
     37 alias hebdate="hdate --hebrew|cut -f 3 -d ','|grep -v '^$'"
     38 alias emptify="truncate -c -s 0"
     39 
     40 function pip3fr () { pip3 freeze --user; }
     41 function pip3i () { pip3 install --user --upgrade $@; }
     42 function pip3up () { pip3i "$( pip3fr | sed 's#==.*##' )"; }
     43 function pip3un () { pip3 uninstall "$*"; }
     44 
     45 # http://cs-syd.eu/posts/2015-06-21-gtd-with-taskwarrior-part-2-collection.html
     46 function inn () { task add +in $@; }
     47 function tickle () {
     48         deadline="$1"
     49         shift
     50         inn +tickle wait:"$deadline" "$*"
     51 }
     52 alias tick=tickle
     53 alias think='tickle +1d'
     54 
     55 alias tracli="transmission-remote-cli"
     56 alias trarem="transmission-remote"
     57 
     58 function ppgrep ()
     59 {
     60         if [[ $1 == "" ]];
     61         then
     62                 PERCOL=percol
     63         else
     64                 PERCOL="percol --query $1"
     65         fi
     66         ps aux | eval "$PERCOL" | awk '{ print $2 }'
     67 }
     68 
     69 function ppkill ()
     70 {
     71         if [[ $1 =~ ^- ]];
     72         then
     73                 QUERY=""
     74         else
     75                 QUERY=$1
     76                 [[ $# -gt 0 ]] && shift
     77         fi
     78         ppgrep $QUERY | xargs kill $*
     79 }