summaryrefslogtreecommitdiff
path: root/skel
diff options
context:
space:
mode:
Diffstat (limited to 'skel')
-rw-r--r--skel/.zshrc.local47
1 files changed, 45 insertions, 2 deletions
diff --git a/skel/.zshrc.local b/skel/.zshrc.local
index 7b485fa..9a58a22 100644
--- a/skel/.zshrc.local
+++ b/skel/.zshrc.local
@@ -16,6 +16,7 @@ setopt correct
setopt hist_reduce_blanks
setopt multios
unsetopt beep
+unsetopt nomatch
bindkey -e
autoload -Uz compinit
@@ -27,6 +28,14 @@ colors
autoload -Uz promptinit
promptinit
+# auto-escape chars when typing urls
+autoload -Uz url-quote-magic
+zle -N self-insert url-quote-magic
+
+# auto-escape chars when pasting urls
+autoload -Uz bracketed-paste-magic
+zle -N bracketed-paste bracketed-paste-magic
+
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' '*?.old' '*?.pro' '*?.class'
# add ~/bin to path
@@ -76,8 +85,6 @@ if main_node; then
alias padoff="/usr/bin/synclient TouchpadOff=1"
alias padon="/usr/bin/synclient TouchpadOff=0"
alias snownews="snownews -u"
- alias cvlc="cvlc --ffmpeg-hw"
- alias vlc="vlc --ffmpeg-hw"
alias biew="TERM=vt100 biew"
exec_exists pm-suspen && alias vsuspend="sudo pm-suspend"
exec_exists trash && alias rm="trash"
@@ -87,6 +94,7 @@ if main_node; then
alias wine32='WINEARCH=win32 WINEPREFIX=/home/astra/.wine32 wine'
alias mc='ssh -p666 dev.somenet.org -L 25565:10.10.0.253:25565'
#alias xflux="/home/astra/git/f.lux/xflux -l 48.21 -g 16.37"
+ alias openwlans='nmcli device wifi rescan ; sleep 2 ; nmcli device wifi list | egrep -v "(WPA1|WPA2|802.1X|WEP)" | grep -v Ad-Hoc | awk "!/^ --/ {print}"'
fi
if main_node; then
@@ -115,4 +123,39 @@ if main_node; then
}
fi
+mping(){ ping $@|awk -F'[=\ ]' '/time=/{t=$(NF-1);f=2000-14*log(t^18);c="play -q -n synth 1 pl "f"&";print $0;system(c)}';} # mping yahoo\.com
+bat(){ calc `cat /sys/class/power_supply/BAT0/energy_now`/`cat /sys/class/power_supply/BAT0/energy_full`; } # show battery state
+
+#pdfgrep(){
+# OLDWORKDIR=`pwd`
+# TMPDIR=`mktemp -d`
+# if [[ "$1" == '-r' && "$3" == "" ]]; then
+# search=$2 ; shift ; shift
+# filelist=`find . -name '*.pdf' -print`
+# elif [[ "$1" == '-r' ]]; then
+# search=$2 ; shift ; shift
+# filelist=`find $* -name '*.pdf' -print`
+# else
+# search=$1 ; shift
+# filelist=$*
+# fi
+#
+# echo "$filelist" | while read file; do
+# filedir=`dirname ${file}`
+# filename=`basename ${file}`
+# mkdir -p ${TMPDIR}/${filedir}/
+# pdftotext ${file} ${TMPDIR}/${filedir}/${filename%.pdf}.txt
+# done
+# cd ${TMPDIR}
+# grep -r "${search}" . | sed 's/\.txt:/.pdf:/'
+# cd ${OLDWORKDIR}
+# /bin/rm -r ${TMPDIR}
+#}
+
[[ ! -z "$DISPLAY" ]] && [ -n "$WINDOWID" ] && exec_exists transset-df && transset-df -i $WINDOWID 0.9 >/dev/null || true
+
+# twitter.com/climagic
+todo(){ cd ~/.todo||return 1&& l=$(ls -1t|head -n1)&&t=$(date +%Y%m%d);[[ "$1" == "last" ]]&&cp $l $t; vim $t;cd -;}
+
+# temp patch
+cd $HOME