kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.4k stars 150 forks source link

Default preview script uses (maybe?) wrong command for mimetype view #374

Open Beethoven-n opened 1 year ago

Beethoven-n commented 1 year ago

For some reason, file --dereference --brief --mime-type "${FILE_PATH}" doesn't show .blend file mimetypes, or the mimetypes of any 3d model file. came across this while messing around with my VRChat avatar.

output for file --dereference --mime-type ${my avatar folder}:

./Beethoven_SoapDog_NEOS.fbx:        application/octet-stream
./CustomHair_EXPORT.blend:           application/zstd
./Meshes_Not For Avatar Importing!!: inode/directory
./SoapDog_3fingerTEST.blend:         application/zstd
./SoapDog_EXPORT.blend:              application/zstd
./SoapDog_EXPORT.blend1:             application/zstd
./SoapDog_EXPORT.blend2.blend:       application/zstd
./SoapDog_EXPORT.blend2.blend1:      application/zstd
./SoapDog_EXPORT.dae:                model/vnd.collada+xml
./SoapDog_EXPORT_NEOS.blend:         application/zstd
./SoapDog_EXPORT_NEOS.blend1:        application/zstd
./SoapDog_EXPORT_NEOS.mtl:           text/plain
./SoapDog_EXPORT_NEOS.obj:           text/plain
./SoapDog_EXPORT.original.blend:     application/zstd
./SoapDog.fbx:                       application/octet-stream
./SoapDog.fbx.070923.old:            application/octet-stream
./SoapDog.fbx.old:                   application/octet-stream
./SoapDogOld.fbx:                    application/octet-stream

after installing the perl-file-mimeinfo package on my distro, as per this forum post, you get a command that outputs better mimetype info in this use case. output from mimetype ${my avatar folder}:

./Beethoven_SoapDog_NEOS.fbx:        application/vnd.fbx
./CustomHair_EXPORT.blend:           application/x-blender
./Meshes_Not For Avatar Importing!!: inode/directory
./SoapDog_3fingerTEST.blend:         application/x-blender
./SoapDog_EXPORT.blend:              application/x-blender
./SoapDog_EXPORT.blend1:             application/zstd
./SoapDog_EXPORT.blend2.blend:       application/x-blender
./SoapDog_EXPORT.blend2.blend1:      application/zstd
./SoapDog_EXPORT.dae:                application/vnd.dae
./SoapDog_EXPORT_NEOS.blend:         application/x-blender
./SoapDog_EXPORT_NEOS.blend1:        application/zstd
./SoapDog_EXPORT_NEOS.mtl:           model/mtl
./SoapDog_EXPORT_NEOS.obj:           model/obj
./SoapDog_EXPORT.original.blend:     application/x-blender
./SoapDog.fbx:                       application/vnd.fbx
./SoapDog.fbx.070923.old:            application/x-trash
./SoapDog.fbx.old:                   application/x-trash
./SoapDogOld.fbx:                    application/vnd.fbx

i'm not sure if the project should really do anything about this, but i thought i should mention it. file --mime-type might have better alternatives, if you want to move forward with those in the preview script instead.

i know i could do something about this on my end, but it is worth considering what the default preview script supports.