Michal-Szczepaniak / nanofiles

3 stars 4 forks source link

add View as Text #5

Closed sbridger closed 3 years ago

sbridger commented 3 years ago

Thanks for making this!.

I am trying to view /etc/location/location.conf which seems to get opened by VPN setup.

I just want to see the text in it!

More generally, a basic filemanager function is to be able to view files using a chosen viewer, not the system default one.

Michal-Szczepaniak commented 3 years ago

That doesn't depend on file manager though it depends on system to show you picker. Basically, text viewer of you choice has to register that it handles x mimetype and add itself to ~/.local/share/applications like my microtube app, lls player and some others and then it will enable sfos to display app picker whenever you click on file with said mimetype

sbridger commented 3 years ago

This argument played out in Windows over 20 years ago, and the conclusion is that a "good" filemanager has to offer basic viewing , as the OS cannot be relied on to offer working viewers. Which is the case above.

This will always be the case as retail OS's will always default to a simplified option, that won't let you view what you want to. Which is the case here.

Basically, text viewer of you choice has to register that it handles x mimetype and add itself to ~/.local/share/applications like my microtube app,

A key point is that viewers for text/hex/binary need to be usable for all mime types, and they must stay registered for all mime types, through the install/remove/update cycles of very bit of software / OS. In desktop OS's that proved to be a bit of a vain hope.

Further, if you did register a universal viewer for every file, it would then prove to be a nuisance ,of of the time. It is a function you only really want when you are exploring the file system, e.g. not when an MP3 file has just been downloaded.

In the end the solution is for the filemanager itself to be able to view all files as text when the user chooses. (or launch the text viewer)

Michal-Szczepaniak commented 3 years ago

Well sailfish is linux, and my desktop linux doesn't offer any file viewing in file manager so i'm gonna stick to that ¯_(ツ)_/¯ sorry