Misc fixes

This commit is contained in:
Austen Adler 2017-02-01 20:16:32 -05:00
parent 718dfe4fa7
commit 148eb9ba44
No known key found for this signature in database
GPG Key ID: 7ECEE590CCDFE3F1

View File

@ -23,6 +23,14 @@ export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.cache/zsh
# Check if a command exists
compress(){
INFILE="${1:r}.tpxz"
if [ -f "$INFILE" ]; then
echo "Won't replace $1" >&2
return 1
fi
tar --xattrs -I pixz -cpf "$INFILE" $*
}
ex(){
command -v "$1" >/dev/null
return $?
@ -298,7 +306,7 @@ alias stdns="sudo sh -c 'echo nameserver 8.8.8.8 > /etc/resolv.conf'"
alias fvim="vim -u NONE +\"so ~/.vim/plugged/flappyvird-vim/plugin/flappyvird.vim\" +\"so ~/.vim/plugged/flappyvird-vim/autoload/flappyvird.vim\" +\":FlappyVird\" +\":q\""
alias fk='k `fzf --no-mouse -m -1 -x`'
#alias susp="sudo true&&((slock;sleep 2;nmcli radio wifi off;nmcli radio wifi on)&echo mem | sudo tee /sys/power/state >/dev/null);sudo -k"
alias susp="sudo true&&((slock;sleep 2;nmcli radio wifi off;nmcli radio wifi on)&echo mem|sudo tee /sys/power/state>/dev/null)"
alias susp="sudo true && (slock&until echo mem|sudo tee /sys/power/state>/dev/null;do sleep 1;done;sleep 4;nmcli radio wifi off;sleep 3;nmcli radio wifi on)"
if ex sudo; then
alias s='sudo -Hu'
fi