X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=bashrc;h=2539fdbe479d03fddb7b91f32e25a3f3e9fb24a8;hb=5a0f6aadad25b4fc660b2d9d67aeb02a240e98db;hp=cbd8a10587f287556806199c8a17813aaf6f60d5;hpb=0f827af6891d1bb2f43cb4caef6f28fcfb12884c;p=scripts.git diff --git a/bashrc b/bashrc index cbd8a10..2539fdb 100644 --- a/bashrc +++ b/bashrc @@ -85,7 +85,8 @@ stty -ixon alias rm='rm -i' alias mv='mv -i' -alias chmod='chmod -v' +# alias chmod='chmod -v' +alias chmod='chmod -c' alias cp='cp -i' alias rd=rmdir alias md=mkdir @@ -133,6 +134,15 @@ function fn () { find $* -name "*${name}*"; } +# Create a dir and cd there + +function mcd () { + mkdir -p $1 + cd $1 +} + +alias trash=trash.sh + ###################################################################### # http://www.reddit.com/r/linux/comments/akt3j/a_functional_programming_style_map_function_for/ @@ -436,7 +446,13 @@ function mksmall () { ;; esac - convert ${rotation_cmd} $i ${PARAMS} ${DEST_DIR}/$i + if [[ -f ${i/JPG/MOV} ]]; then + CAPTION_PARAMS="-font vera-sans -pointsize 24 -fill white -annotate +10+32 Video" + else + CAPTION_PARAMS="" + fi + + convert ${rotation_cmd} $i ${PARAMS} ${CAPTION_PARAMS} ${DEST_DIR}/$i fi \ls -lt ${DEST_DIR}/$i NB=$((NB+1)) @@ -671,7 +687,8 @@ alias dus='dus -f' # # git clone http://fleuret.org/git/finddup/ -alias finddup='finddup -p0d' +# alias finddup='finddup -p0d' +alias finddup='finddup -p' ###################################################################### # This script grep messages in my mail archives @@ -686,23 +703,7 @@ alias gma='gma.sh' # git clone http://fleuret.org/git/selector/ function selector-history () { - ARGS="-c 7 4 0 3 -q -b -i -d -v -w -l 15000" - FILES="" - - # I may have a "local bash history" specific to the current - # directory, and I also maintain a global "kept command" file. I - # take all this into account here. - - if [[ ${LOCAL_HISTORY_FILE} ]] && [[ -f ${LOCAL_HISTORY_FILE} ]]; then - FILES="${FILES} ${LOCAL_HISTORY_FILE}" - fi - - if [[ ${KEPT_COMMANDS} ]] && [[ -f ${KEPT_COMMANDS} ]]; then - selector ${ARGS} ${FILES} <(sed < ${KEPT_COMMANDS} -e 's/^.*: /0 /') <(history) - else - selector ${ARGS} ${FILES} <(history) - fi - + selector -c 7,4,0,3 -q -b -i -d -v -w -l 15000 <(history) } # M-r puts the selected history line in place of the current one @@ -713,7 +714,7 @@ bind '"\C-[r":"\C-a\C-kselector-history\C-m"' bind '"\C-[t":"\C-a\C-kselector-history\C-m\C-a\C-y\C-e"' -# Finds path in the history and make a list of the existing ones +# Find pathes in the history and make a list of the existing ones function selector-cd () { LIST_TEMP=$(mktemp /tmp/cdlist.XXXXXX) @@ -730,8 +731,6 @@ function selector-cd () { \rm ${LIST_TEMP} } -alias c=selector-cd - bind '"\C-[c":"\C-a\C-kselector-cd\C-m"' # And we avoid to put in the history the use of the selector, which we @@ -747,7 +746,7 @@ function prompt_command () { history -a # and the local histories system defined above keep_local_history -# and the no-history +# and the history cue histfile_cue }