alias val='valgrind --leak-check=full --show-reachable=yes --db-attach=yes '
alias s='screen -d -R -U && clear'
+alias p='feh --force-aliasing -d --full-screen --auto-zoom'
function nh () {
export HISTFILE=/dev/null
unalias cd
}
+function select-tz () {
+ # Select a value for TZ
+ TMP=$(mktemp /tmp/select-tz.XXXXXX)
+ selector -o "${TMP}" <(grep -v ^# /usr/share/zoneinfo/zone.tab | awk '{print $3}' | sort -u)
+ cat "${TMP}"
+ \rm -f "${TMP}"
+}
+
function ding () {
if [[ $1 ]] && which winshepherd.sh; then
play -q ~/local/sounds/deskbell.wav &
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" == "a4crop" ]]; then
+ OPTS+=" -l 5 -t 0 -x 200 -y 290"
+ else
+ echo "Unknown argument \`$1'"
+ fi
+ shift
+ done
+
+ echo "**"
+ echo "** Scanning to ${HOME}/scan-${n}.jpg"
+ echo "**"
+
+ scanimage -d genesys:libusb:001:056 \
+ --format=pnm \
+ --mode=color \
+ --depth=8 \
+ -v \
+ --resolution=300 \
+ ${OPTS} | \
+ convert -rotate 180 - "${HOME}/scan-${n}.jpg"
+
+ echo "** Done".
+}
+
# A password generator
function genpw () {
}
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}
## A version of date that shows the time at home if TZ is set
function dt () {
- echo "Local: $(date)"
- if [[ ${TZ} ]]; then
- local TZ=$(cat /etc/timezone)
- echo "Home: $(date)"
- fi
+ echo "Local - $(date)"
+ unset TZ
+ echo "Home - $(date)"
}
######################################################################
PS1="\[${VT_WHITE_BG}\]\${LOCAL_HISTORY_HINT}\[${VT_RESET}\]${PS1}"
######################################################################
-# Switch off the history
+# Show the history path if it is unusual
function histfile_cue () {
if [[ ! "${HISTFILE}" == "${HOME}/.bash_history" ]]; then
# Displaying the timezone if it is set
-if [[ ${TZ} ]]; then
- echo "${VT_BLUE_FG}Time zone is ${TZ}.${VT_RESET}"
-fi
+[[ ${TZ} ]] && echo "${VT_BLUE_FG}Time zone is ${TZ}.${VT_RESET}"
######################################################################