commit 05442b039da63d5423038da1e7ac5dae95ff8e8c
parent 46fe323e1fcfeae93c52a725ec1751e432d91aad
Author: Yuval Langer <yuval.langer@gmail.com>
Date: Sun, 6 Nov 2016 14:40:25 +0200
Update bash aliases and rc dotfiles
Diffstat:
2 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/bash/bash_aliases b/bash/bash_aliases
@@ -2,7 +2,12 @@
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
- test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
+ test -r ~/.dircolors
+ if [[ $? == 0 ]]; then
+ eval "$(dircolors -b ~/.dircolors)";
+ else
+ eval "$(dircolors -b)"
+ fi
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
@@ -32,21 +37,43 @@ alias ec="emacsclient"
alias hebdate="hdate --hebrew|cut -f 3 -d ','|grep -v '^$'"
alias emptify="truncate -c -s 0"
-pip3ls () {
- pip3 freeze --user | sed 's#==.*##'
-}
-alias pip3i="pip3 install --user --upgrade"
-pip3up () {
- pip3i `pip3ls`
-}
-alias pip3un="pip3 uninstall"
+function pip3fr () { pip3 freeze --user; }
+function pip3i () { pip3 install --user --upgrade $@; }
+function pip3up () { pip3i "$( pip3fr | sed 's#==.*##' )"; }
+function pip3un () { pip3 uninstall "$*"; }
# http://cs-syd.eu/posts/2015-06-21-gtd-with-taskwarrior-part-2-collection.html
-alias in='task add +in'
-tickle () {
+function inn () { task add +in $@; }
+function tickle () {
deadline="$1"
shift
- in +tickle wait:"$deadline" $@
+ inn +tickle wait:"$deadline" "$*"
}
alias tick=tickle
alias think='tickle +1d'
+
+alias tracli="transmission-remote-cli"
+alias trarem="transmission-remote"
+
+function ppgrep ()
+{
+ if [[ $1 == "" ]];
+ then
+ PERCOL=percol
+ else
+ PERCOL="percol --query $1"
+ fi
+ ps aux | eval "$PERCOL" | awk '{ print $2 }'
+}
+
+function ppkill ()
+{
+ if [[ $1 =~ ^- ]];
+ then
+ QUERY=""
+ else
+ QUERY=$1
+ [[ $# -gt 0 ]] && shift
+ fi
+ ppgrep $QUERY | xargs kill $*
+}
diff --git a/bash/bashrc b/bash/bashrc
@@ -133,3 +133,4 @@ export PATH
# http://cs-syd.eu/posts/2015-06-21-gtd-with-taskwarrior-part-2-collection.html
export PS1='$(task +in +PENDING count)i$(task count)t '$PS1
+if command -v find_pycompletion.sh>/dev/null; then source `find_pycompletion.sh`; fi