commit 17c6a59491a776faf18060a7ba7177cb0bf8ea69
parent 266e0bb921bfb181ff914c2d725c5552a2e5f4bb
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 28 Apr 2020 07:37:35 +0200
Add -w option for plumb and use it for application/* attachments in mutt
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.local/bin/plumb b/.local/bin/plumb
@@ -12,6 +12,7 @@ show_help() {
echo "OPTIONS are one or more of the following:"
echo " -h show this message"
echo " -v show version and license information"
+ echo " -w do not end program before child processes are finished"
echo " -V show verbose information"
echo " -- do not consider any following args as options"
}
@@ -29,7 +30,11 @@ die() {
}
detach() {
- nohup "$@" >/dev/null 2>&1 &
+ if [ "$wait" = 1 ]; then
+ "$@"
+ else
+ nohup "$@" >/dev/null 2>&1 &
+ fi
}
regexmatch() {
@@ -220,6 +225,7 @@ handle_target() {
}
verbose=0
+wait=0
while :; do
case "$1" in
-h)
@@ -233,6 +239,9 @@ while :; do
-V)
verbose=1
;;
+ -w)
+ wait=1
+ ;;
--) # end all options
shift
break
diff --git a/.mailcap b/.mailcap
@@ -3,5 +3,5 @@ text/html; w3m -I %{charset} -o display_link_number=1 -T text/html; copiousoutpu
text/plain; cat %s; copiousoutput; needsterminal
text/*; plumb %s; needsterminal
image/*; plumb %s && sleep 2
-application/*; plumb %s && sleep 2
+application/*; plumb -w %s
video/*; plumb %s && sleep 2