-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.lessfilter
executable file
·62 lines (58 loc) · 1.13 KB
/
.lessfilter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#
# $Id: lessfilter 761 2007-03-19 15:50:41Z suriya $
#
# This is the file ~/.lessfilter (Check its permissions)
# $ ls -l .lessfilter
# -rwxr-xr-x 1 suriya users 504 Jun 22 20:36 .lessfilter
#
# Read the lesspipe manpage for further details
case "$1" in
*.mp4)
AtomicParsley "$1" -T 1
;;
*.so)
readelf -a "$1"
;;
*.xcf)
file "$1"
;;
*.pdf)
pdftotext "$1" -
;;
*.pdf.gz)
TEMPORARY_FILENAME=`tempfile --suffix .pdf`
zcat "$1" > ${TEMPORARY_FILENAME}
pdftotext ${TEMPORARY_FILENAME} -
# rm ${TEMPORARY_FILENAME}
;;
*.html)
lynx -dump "$1"
;;
*.htm)
lynx -dump "$1"
;;
*.ps.gz)
zcat "$1" | ps2ascii -
;;
*.ps)
ps2ascii "$1"
;;
*.dvi)
catdvi "$1"
;;
*.dvi.gz)
zcat "$1" | catdvi -
;;
*.ogg)
ogginfo "$1"
;;
*.doc)
catdoc "$1"
;;
*)
# We don't handle this format.
exit 1
esac
# No further processing by lesspipe necessary
exit 0