Shell: webdl aliases replaced by webdl function.

master
Pierre Neidhardt 2013-03-08 13:49:59 +01:00
parent 22b6291669
commit 3ffd37a2a4
2 changed files with 30 additions and 4 deletions

View File

@ -91,10 +91,6 @@ alias xmorphzi='xrandr --output $(xrandr | grep "\<connected\>" | cut -f1 -d" ")
alias xres='xrandr -s $(xrandr | awk '"'"'/^ / {print $1;exit}'"'"')'
# Web videos DL
alias webdl720='movgrab -f webm:1280x720'
alias webdl1080='movgrab -f webm:1920x1080'
##==============================================================================
## Zsh power aliases
##==============================================================================

View File

@ -374,6 +374,36 @@ pgex ()
ps aux | grep "$(echo "$@" | sed 's/./[&]/;q')"
}
# Web videos DL
webdl ()
{
if [ -z "$(command -v movgrab)" ]; then
echo "Install movgrab."
return
fi
if [ $# -ne 2 ]; then
echo "Usage: ${0##*/} RES URI"
return
fi
RES=""
case $1 in
1080)
RES=1920x1080
;;
720)
RES=1280x720
;;
*)
RES=640x360
;;
esac
movgrab -f webm:$RES "$2"
}
##==============================================================================
## Pacman functions
##==============================================================================