Misc
authorFrancois Fleuret <francois@fleuret.org>
Wed, 11 Aug 2010 11:08:20 +0000 (13:08 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 11 Aug 2010 11:10:08 +0000 (13:10 +0200)
archivepics.sh
bashrc
gma.sh

index 202d73c..82f3506 100755 (executable)
 
 [[ ${archive_size_min} ]] || archive_size_min=1048576 # 1Mb
 
+# if [[ -z $* ]] && [[ ${PHO_NOTE_1} ]]; then
+    # echo "$0 ${PHO_NOTE_1}"
+    # $0 ${PHO_NOTE_1}
+    # exit 0
+# fi
+
+export ARCHIVED_PICS="$*"
+
 set -e
 
 if [[ ! ${IMAGE_ARCHIVE_DIR} ]]; then
@@ -60,7 +68,7 @@ for i in "$@"; do
     if [[ -f ${base}.jpg ]]; then ref=${base}.jpg; fi
     if [[ -f ${base}.jpeg ]]; then ref=${base}.jpeg; fi
 
-    echo "ref=${ref}"
+    echo "ref=${ref}"
 
     if [[ -f ${ref} ]]; then
 
diff --git a/bashrc b/bashrc
index cbd3ac2..5be565d 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -374,7 +374,7 @@ function dvd () {
 function ripdvd () {
     mkdir -p ${HOME}/dvds
     cd ${HOME}/dvds
-    dvdbackup -v -M && eject
+    time dvdbackup -v -M && eject
 }
 
 ######################################################################
@@ -713,7 +713,7 @@ alias gma='gma.sh'
 # git clone http://fleuret.org/git/selector/
 
 function selector-history () {
-    selector --bash -c 7,4,0,3 -q -l 15000 <(history)
+    selector --bash -c 7,4,0,3 -q <(history)
 }
 
 # Find pathes in the history and make a list of the existing ones
@@ -753,6 +753,15 @@ bind '"\C-[c":"\C-a\C-kselector-cd\C-m"'
 
 HISTIGNORE="${HISTIGNORE}:selector-history"
 
+function selector-printer () {
+    TMP=$(mktemp /tmp/selector-printer.XXXXXX)
+    selector -o ${TMP} <(lpstat -a | awk '{print $1}')
+    export PRINTER=$(cat ${TMP})
+    echo "PRINTER=${PRINTER}"
+    rm -f ${TMP}
+    lpq
+}
+
 ######################################################################
 
 function prompt_command () {
diff --git a/gma.sh b/gma.sh
index 46992a3..1e79c72 100755 (executable)
--- a/gma.sh
+++ b/gma.sh
@@ -67,6 +67,9 @@ while [[ $1 ]]; do
 
         *)
             if [[ ${PATTERN} ]]; then
+                # If we already have the pattern to match in the
+                # message, get the new argument as a pattern for the
+                # filename
                 if [[ ${FILE_PATTERN} ]]; then
                     usage
                     exit 1
@@ -88,7 +91,7 @@ if [[ -z "${PATTERN}" ]]; then
 fi
 
 [[ ${FILE_PATTERN} ]] || FILE_PATTERN="${MAIL_ARCHIVE_DIR}/*/*/*"
-[[ ${SIZE_FILE_PATTERN} ]] || SIZE_FILE_PATTERN="${MAIL_ARCHIVE_DIR}/"
+[[ ${SIZE_FILE_PATTERN} ]] || SIZE_FILE_PATTERN="${MAIL_ARCHIVE_DIR}"
 
 SIZE=$(\dus ${SIZE_FILE_PATTERN} | cut -f 1 -d" ")