From de6bde6c9f9529c1537904ce339b057783e421f7 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Fri, 2 Apr 2010 20:50:03 +0200 Subject: [PATCH] *** empty log message *** --- bashrc | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) 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 } -- 2.39.5