treesheets
treesheets copied to clipboard
.cts files in Linux do not seem to have an assigned Magic Number
In Linux, installations need to have the Magic Number to .cts files added.
I believe the file starts with "TSFF\n", but please do correct me if I am wrong. Without it, .cts files are listed as "unknown type" and it is NOT possible to open a .cts file by double clicking on the link, or alternatively ALL files of the type "unknown" are being open by Treesheets (which is not the desirable outcome).
I am not sure who is empowered to request it.
what do you mean, "linux" ? is this a specific window manager / file manager under linux (kde / gnome ?) how do programs normally register file extensions or file headers there?
A MIME type for TreeSheets needs to be added: https://freedesktop.org/wiki/Specifications/AddingMIMETutor/
Anyone on Linux wants to test adding these files, then send a PR to this repo?
Sorry, should have been more specific. Linux Mint ulyssa/focal it is. I am using XFCE.
OK here's a workaround. I am not skilled enough in github-fu to make a pull request; someone please help.
- Add the following lines to
/etc/magic
and/etc/magic.mime
:
0 string TSFF treesheets archive
!:mime application/prs.treesheets
This takes care of the first issue, the system not recognizing .cts
archives as anything special. Now we'll create the actual mime type.
- Add a file named treesheets.xml to /usr/share/mime/packages, containing:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/prs.treesheets">
<comment>Treesheets Archive</comment>
<glob pattern="*.cts"/>
<icon name="treesheets"/>
</mime-type>
</mime-info>
- Run
sudo update-mime-database /usr/share/mime
Now the mime type application/prs.treesheets
exists, and we can use it to associate .cts
files with the treesheets
application.
- Right-click any .cts file in your favourite file manager (FWIW I use
thunar
, your mileage may vary with others) and selecttreesheets
to always handle this type of file.
END RESULT:
DONE
P.S. I used application/prs.treeshheets
for mime type. This makes it a personal mime type. Obviously, the developer needs to use a vnd.xxxxxxx
type instead, but it's not my prerogative to select a public mime type.
@morciej the instructions you gave are all system changes, as opposed to changes to this repo. So a PR would need to take the form of some kind of install script, that does what you did automatically?
What of your instructions is or isn't applicable to other Linux setups?
I suppose so. I am not a programmer, just an amateur system administrator of this particular Linux Mint, old beater of a desktop. I never worked with a Slackware/Debian/Ubuntu/Arch/Fedora, so I can't answer these questions. But the idea of magic numbers and mime types is universal to Linux, so it should work, with distribution-specific adjustments, on any. As for how to do it using install scripts, that's way beyond my capability. It would require knowledge of packaging and scripting that I simply don't have. I am sure others can help pull it together. Right?
Another option is adding the entry to https://gitlab.freedesktop.org/xdg/shared-mime-info. That way, distros will know about the MIME type even without TreeSheets installed, and be able to suggest a package to install when user tries to open it.
It might also be nice to officially register a MIME type (likely application/vnd.treesheets
) with IANA: