Add image compression functions and qmv alias

Jonathan Hodgson 7 years ago
parent d15048b8dc
commit be45e954a3
  1. 3
      config/oh-my-zsh/aliases.zsh
  2. 26
      config/oh-my-zsh/functions.zsh

@ -11,6 +11,9 @@ alias ls='ls -F --color=auto'
# Make tree add indicators and color
alias tree='tree -F -C'
# Make qmv open on 1 column mode
alias qmv='qmv -f do'
alias msfconsole="msfconsole --quiet -x \"db_connect msf@msf\""
#Start cups

@ -188,3 +188,29 @@ searchphp() {
searchhtml() {
grep -r -i -n --color="always" --include=\*.{html,htm} "$1" .
}
png() {
pngcrush -brute "$1"{,.} && du -b "$1"{,.}
}
gif() {
gifsicle -O "$1" -o "$1." && du -b "$1"{,.}
}
jpeg() {
jpegtran "$1" > "$1." && du -b "$1"{,.}
}
# Just for easy access in history
mpng() {
mv "$1"{.,}
}
mgif() {
newsize=$(wc -c <"$1.")
oldsize=$(wc -c <"$1")
if [ $oldsize -gt $newsize ] ; then
mv "$1"{.,}
else
rm "$1."
fi
}
mjpeg() {
mv "$1"{.,}
}

Loading…
Cancel
Save