Distinguishing zip and xlsx files

For a while now, have had an issue with opening zip/xlsx files - my file managers want to use the same program…
ie set one to open with Libreoffice, and from then on Libreoffice wants to open both. Change zips to open with ark, and all libreoffice files then try to open with ark…
Believe I need to set then to open by EXTENSION rather than contents…
How can I do this?
Never used to be a problem…

@hornetster Hi if you run file -i <your_xlsx_file> on the problem files, what does it return for the mime type?

.xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=binary

You could start with describing what file managers you are using.

Same ones I have been using for the last 10 years - Dolphin and Krusader…

As longtime Plasma user it shouldn‘t be that hard to check and adjust file type associations in systemsettings then…

My thought too, but separating zip and xlsx is not as simple as I thought…
Apparently both are classed as zip, and difficult to separate.
As I said, this wasn’t an issue until a couple of months ago…

Hi,

Might not be what you wanted but in kde you could do:

kcmshell5 filetypes

Or if you know the file type mime info, something like:

keditfiletype application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

keditfiletype application/zip

Mine defaults to Libreoffice and ark.

How do you “change zips to open with ark”? Are MIME types the same for both files?

xdg-mime query filetype file.xlsx
xdg-mime query filetype file.zip

When you open file properties in Dolphin, what types these files have?

Yes, seeing it here with Leap 15.4 as well – KDE Plasma System SettingsPersonalizationApplicationsFile Associations:

  • Search for “.xl” –
    application/vnd.ms-excel → .xls but not .xlsx → all OK.
    application/vnd.ms-excel.???.macroEnabled.12 → all OK → nothing can support the things …
    application/vnd.ms-excel.sheet/template.macroE/enabled.12 → (.xlsm or .xltm) – Ark opens the things …
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet → (.xlsx) → I have LibreOffice Calc as the first choice and Ark as the second choice – but, I may have changed that at some point in the past …
    application/vnd.openxmlformats-officedocument.spreadsheetml.template → (.xltx) ditto → same as the sheet …

Strange is –

  • application/vnd.oasis.opendocument.spreadsheet → (.ods) – also LibreOffice calc and Ark:face_with_raised_eyebrow:

By removing the unwanted app, as example ark for .ods, or lowering priority, the prob should dissapear…

But also check the ark settings too. It can claim ownership over many many file types…

Changing the choice priority in the KDE System Settings entries is sufficient.