-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.3 | ||
0.3-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
application/*; mutt-qlview %s | ||
audio/*; mutt-qlview %s | ||
image/*; mutt-qlview %s | ||
text/*; mutt-qlview %s | ||
text/html; mutt-qlview %s; nametemplate=%s.html; | ||
video/*; mutt-qlview %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# | ||
# Wrapper around qlview for use from mutt's mailcap. qlview must be in same | ||
# path as this script, or inside $PATH. The script initially retain a copy of | ||
# the file being viewed, which will it will delete when running for the 1st | ||
# time day later, or when run again with the same file name. | ||
|
||
prog=$0 | ||
|
||
usage() { | ||
echo "usage: $(basename "${prog}") <file>" | ||
exit 1 | ||
} | ||
|
||
error() { | ||
echo "$(basename "${prog}"): $*" >&2 | ||
exit 1 | ||
} | ||
|
||
qlview="$(cd "$(dirname "$0")" && pwd)/qlview" | ||
test -f "${qlview}" -a -x "${qlview}" || qlview="$(command -v qlview 2>/dev/null)" | ||
|
||
test -n "${qlview}" || error "qlview not found" | ||
test $# -eq 1 || usage | ||
|
||
file="$1" | ||
test -f "${file}" || error "no file '${file}'" | ||
|
||
tmpdir="${HOME:?}/.cache/mutt" | ||
mkdir -m 0700 -p "${tmpdir}" | ||
find "${tmpdir}" -maxdepth 1 -type f -mtime +1d -delete | ||
|
||
tmpfile="${tmpdir}/$(basename "${file}")" | ||
mkdir -p "${tmpdir}" | ||
cp -f "${file}" "${tmpfile}" | ||
|
||
nohup "${qlview}" "${tmpfile}" >/dev/null 2>&1 </dev/null & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Drectly open first HTML attachment with qlview from index and pager. | ||
macro index,pager V <view-attachments>/html\n<view-mailcap><quit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters