Shell: webdl aliases.

Shell: completion for some scripts.
Scripts: minor fixes.
master
Pierre Neidhardt 2013-03-06 22:37:14 +01:00
parent ee082ddf2c
commit 989691a67e
3 changed files with 24 additions and 2 deletions

View File

@ -2,10 +2,19 @@
## Format C using 'indent'. Alternative to indent: astyle, uncrustify. ## Format C using 'indent'. Alternative to indent: astyle, uncrustify.
if [ -z "$(command -v indent)" ]; then if [ -z "$(command -v indent)" ]; then
echo "Please install 'indent'" echo "Please install 'indent'."
exit exit
fi fi
if [ "$1" = "-h" ]; then
cat<<EOF
Usage: ${0##*/} [FILES|FOLDERS]
Format C source code using indent.
EOF
fi
_formatc_dir() _formatc_dir()
{ {
find "$1" -type f \ find "$1" -type f \
@ -27,7 +36,10 @@ if [ $# -eq 0 ]; then
fi fi
for i ; do for i ; do
echo "[$i]" if [ ! -e "$i" ]; then
continue
fi
if [ -d "$i" ]; then if [ -d "$i" ]; then
_formatc_dir "$i" _formatc_dir "$i"

View File

@ -91,6 +91,10 @@ alias xmorphzi='xrandr --output $(xrandr | grep "\<connected\>" | cut -f1 -d" ")
alias xres='xrandr -s $(xrandr | awk '"'"'/^ / {print $1;exit}'"'"')' 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 ## Zsh power aliases
##============================================================================== ##==============================================================================

View File

@ -3,11 +3,17 @@
## Completion ## Completion
##============================================================================== ##==============================================================================
if [ "zsh" = "$SHELL_CURRENT" ]; then if [ "zsh" = "$SHELL_CURRENT" ]; then
compdef _gcc crun
compdef _gcc formatc
compdef _gs pdfcompress
compdef _gs pdfextract
compdef _gs pdfresize
compdef _pacman pacman-color compdef _pacman pacman-color
compdef _pcc pacman-deps compdef _pcc pacman-deps
compdef _pcc pacman-files compdef _pcc pacman-files
compdef _pcc pacman-size compdef _pcc pacman-size
compdef _pcc pql compdef _pcc pql
compdef _tex ltx
compdef _zathura zat compdef _zathura zat
elif [ "bash" = "$SHELL_CURRENT" ]; then elif [ "bash" = "$SHELL_CURRENT" ]; then
complete -o default -o nospace -F _pacman pacman-color complete -o default -o nospace -F _pacman pacman-color