X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=bashrc;h=b9cefb422c405fd846e4ea0074c65e6ede5c619c;hb=caef54051c89be32e693aeed90fa915f621fce47;hp=dd9bc904f614bb18f383c6e305a44eec443b4266;hpb=0acec4f7f3292ea19e685c70ce9b300f0fe9c9c2;p=scripts.git diff --git a/bashrc b/bashrc index dd9bc90..b9cefb4 100644 --- a/bashrc +++ b/bashrc @@ -92,6 +92,10 @@ export LESS_TERMCAP_ue=${VT_RESET} export LESS_TERMCAP_md=${VT_BLUE_FG}${VT_BOLD} export LESS_TERMCAP_me=${VT_RESET} +# I do not like to clutter my home with history files + +export LESSHISTFILE=/dev/null + # export LESS_TERMCAP_md=$'\e[1;34;40m' # This prevents ^S from freezing the shell @@ -188,10 +192,10 @@ function rl () { if [[ -f "${FILEBASE}.tex" ]]; then - pdflatex "${FILEBASE}" + pdflatex --shell-escape "${FILEBASE}" bibtex "${FILEBASE}" - pdflatex "${FILEBASE}" - pdflatex "${FILEBASE}" + pdflatex --shell-escape "${FILEBASE}" + pdflatex --shell-escape "${FILEBASE}" if [[ "$1" ]]; then if [[ "$1" == "-v" ]] || [[ "$1" == "--view" ]]; then @@ -251,6 +255,46 @@ function bak () { done } +function scan () { + n=1 + + while [[ -f "${HOME}/scan-${n}.jpg" ]]; do + n=$((n+1)) + done + + while [[ "$1" ]]; do + if [[ "$1" == "color" ]]; then + OPTS+=" --mode Color" + elif [[ "$1" == "gray" ]]; then + OPTS+=" --mode Gray" + elif [[ "$1" == "a4crop" ]]; then + OPTS+=" -l 5 -t 0 -x 200 -y 300" + elif [[ "$1" == "help" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then + echo "$0 [color|gray] [a4crop]" && return 0 + else + echo "Unknown argument \`$1'" + fi + shift + done + + echo "**" + echo "** Scanning to ${HOME}/scan-${n}.jpg" + echo "**" + + SCANNER=$(scanimage -L | grep "Canon LiDE 60" | sed -e "s/^.*\`\(.*\)'.*$/\1/") + + scanimage -d ${SCANNER} \ + --format=pnm \ + --mode=color \ + --depth=8 \ + -v \ + --resolution=300 \ + ${OPTS} | \ + convert -rotate 180 - "${HOME}/scan-${n}.jpg" + + echo "** Done". +} + # A password generator function genpw () { @@ -338,7 +382,7 @@ alias t='cd /tmp' alias a='cd /tmp/at' function trash () { - TRASH=$(date +/tmp/trash-%Y-%b-%d-%Hh) + TRASH=$(date +/tmp/trash-${USER}-%Y-%b-%d-%Hh) LINK=/tmp/trash mkdir -p ${TRASH} @@ -709,7 +753,9 @@ function mvtoconfig () { export PS1 if [[ "${CONSOLE}" == "yes" ]]; then + PS1="" + else # If the login is a standard one (as specified in @@ -744,6 +790,8 @@ else fi +PS1="${PSCUE}${PS1}" + ###################################################################### # This implements a local history. If we are in a directory containing # a writable local history file, we add the last line of the global @@ -890,6 +938,9 @@ EOF ###################################################################### function prompt_command () { + [[ "${CORE_CHECK_PWD}" == ${PWD} ]] || find . -maxdepth 1 -name "core__*" | awk '{print "'${VT_RED_FG}'"$0"'${VT_RESET}'"}' + CORE_CHECK_PWD=${PWD} + # if [[ $(umask) != 0022 ]]; then # echo "Umask changed to $(umask)" # fi