From: Francois Fleuret Date: Fri, 2 Apr 2010 18:50:03 +0000 (+0200) Subject: *** empty log message *** X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=commitdiff_plain;h=de6bde6c9f9529c1537904ce339b057783e421f7 *** empty log message *** --- diff --git a/bashrc b/bashrc index cbd8a10..6ca8dcd 100644 --- a/bashrc +++ b/bashrc @@ -133,6 +133,14 @@ function fn () { find $* -name "*${name}*"; } +# Move things to a trash directory in /tmp/ + +function trash () { + TRASH=$(date +/tmp/trash-%Y-%b-%d-%H_%M_%S) + mkdir ${TRASH} && mv $* ${TRASH} + \ls -ad ${TRASH}/* +} + ###################################################################### # http://www.reddit.com/r/linux/comments/akt3j/a_functional_programming_style_map_function_for/ @@ -436,7 +444,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)) @@ -686,23 +700,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 +711,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 +728,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 +743,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 }