mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Introduced new libraries for mime, thumbnails, labels
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
0ab8c73e07
commit
e173c4613c
4 changed files with 219 additions and 0 deletions
22
inc/nux.mime.inc.sh
Normal file
22
inc/nux.mime.inc.sh
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
nux.mime() {
|
||||
local type=binary/octet
|
||||
local suffix="${1##*.}"
|
||||
case "${suffix,,}" in
|
||||
txt) type=text/plain;;
|
||||
css) type=text/css;;
|
||||
jpg) type=image/jpeg;;
|
||||
png) type=image/png;;
|
||||
zip) type=application/zip;;
|
||||
cbr) type=application/x-cbz;;
|
||||
cbz) type=application/x-cbr;;
|
||||
pdf) type=application/pdf;;
|
||||
epub) type=application/epub+zip;;
|
||||
mp4) type=video/mp4;;
|
||||
*)
|
||||
if [ -d "$1" ]; then
|
||||
type=directory
|
||||
fi
|
||||
esac
|
||||
echo $type;
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue