-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview
More file actions
34 lines (30 loc) · 762 Bytes
/
Copy pathview
File metadata and controls
34 lines (30 loc) · 762 Bytes
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
#########################################
# text editor: mousepad #
# image viewer: sxiv #
# text file editor: odt2txt/catdoc #
# pdf viewer: mupdf #
#########################################
export file=$1
export filetype=$(file $1)
if [[ $filetype == *"ASCII"* || $filetype == *"text"* ]]
then
mousepad $file
elif [[ $filetype == *"image data"* ]]
then
sxiv $file
elif [[ $filetype == *"PDF"* ]]
then
mupdf $file
elif [[ $filetype == *"Video"* || $filetype == *"MP4"* || $filetype == *"MPEG"* || $filetype == *"WebM"* ]]
then
vlc $file
fi
for arg; do
if [ "$arg" != "${arg%.odt}" ]; then
odt2txt $arg > /tmp/odttemp
mousepad /tmp/odttemp
elif [ "$arg" != "${arg%.doc}" ]; then
catdoc $arg > /tmp/doctemp
mousepad /tmp/doctemp
fi
done