feat: allow configuring archive app#1555
Conversation
93c1740 to
480374f
Compare
jacobgkau
left a comment
There was a problem hiding this comment.
This did get archives to open in File Roller instead of prompting for extraction in COSMIC Files when File Roller was installed (which it is by default in Pop!_OS), but there are a couple of side effects that aren't desirable.
-
When I uninstalled
file-rollerbut happened to have Nautilus installed on the machine, COSMIC Files launched Nautilus when I tried to open the archive file. Nautilus just automatically extracted the file without even prompting-- this is more destructive than COSMIC Files's current behavior, since COSMIC Files prompts to select the extraction destination first. -
After removing Nautilus, the archive file opened up in Firefox, which just offered to re-save the file (and is not actually able to extract it).
If we want to make this change, we'd probably want to detect if any suitable apps are available to handle the archive, but fall back to our extractor if there aren't any suitable apps, rather than falling back to less suitable apps.
480374f to
d2983b6
Compare
Hello, thanks for your analysis. I tried to address your points by adding a new function, On my test system, I had XArchiver, KDE's Ark, GNOME's File Roller, and Nautilus installed. I tested uninstalling them one by one, and in each case the system used the available archiver app. Once no suitable archiver was left, instead of defaulting to Nautilus or Firefox, it correctly fell back to showing the edit: I forgot to mention that If I try to open a txt and a zip without any installed archiver apps, it opens the txt and the edit: I see that if I try to open multiple archive files with the extract_to dialog (no archiver apps installed), cosmic-files crashes. With the "standard" cosmic-files, it extracts only the first one. Is it correct or Am I testing it wrongly? How do we want to handle this here? |
|
ok I pushed a fix, now ti doesn't crash anymore but it seems like it extracts only the first archive when multiple archive files are opened and there are no suitable apps. It seems like it is a problem with the standard cosmic-files so it should be addressed in a separate PR maybe? edit: tests performed until now (checked means ok)
|
jacobgkau
left a comment
There was a problem hiding this comment.
Thanks for shaping that up a little bit!
Our UX team noticed this PR (I would've needed to request review from them anyway once this was working) and let me know that they aren't favorable towards this solution-- they don't think users generally want to see what's in archives before extracting them. However, they do think there should be a way to configure archives to open in another app if you'd prefer.
What they're asking for is a solution where a default application for archives is listed in Settings -> Default Applications. The default (at least in Pop!_OS) should be COSMIC Files Extract to..., as it currently is; COSMIC Files Extract (for Nautilus's behavior of extracting to the current directory without prompting), along with any other archive apps, should also be listed. This would keep the default behavior as it currently is, but allow you to set e.g. File Roller as the default if you'd prefer to always browse archives first.
In order to do this, I think we'd need to add action stanzas within the COSMIC Files .desktop file (if not other .desktop files for these other actions), so the Extract and Extract to... options in the right-click menu can be exposed as apps in the Default Applications Settings page.
I understand this is slightly beyond the scope of what you were trying to do. Let me know if you'd still like to attempt it.
Yes, what you’re proposing makes perfect sense. Adding Desktop Actions (
For these reasons, it’s probably not the ideal solution. The approach I suggest is:
It is much simpler and more user-friendly i believe. Main advantages
|
|
This is a preview of how it could be. 2026-02-06.11-57-43.mp4Still didn't push the last modifications I made in cosmic-files to record the video. This is independent from cosmic-settings and fully testable using |
|
The UX team still wants it the way they've described. Some of our engineers say adding |
0374d94 to
9cca679
Compare
|
Sure, pushed. I’m not sure if I did something wrong, but the actions still appear in the launcher even with Moreover, with the current cosmic-settings implementation, I only see "cosmic-files" in general and not its actions. It probably needs a better implementation — I just duplicated the ones used for other file types, which work with the edit: I’ve pushed the changes to my branch in cosmic-settings: https://github.com/thegabriele97/cosmic-settings/tree/feat_default_archive_app. I’m not sure if you’d like a PR for this — I can open a draft if that helps. |
27b8ebc to
9932d35
Compare
9932d35 to
31c2228
Compare
|
The fact that it only extracts one file seems to be an issue not caused by me (I initially thought it was my fault). #1600 |
31c2228 to
9f62db1
Compare
|
@thegabriele97 Please do open a pull request with your cosmic-settings branch as well. It will help us keep the required work organized. For now, I'm pushing your branch to the same internal |
sure, done. pop-os/cosmic-settings#1860 Do I need to fix the CI? I actually forgot to run |
It would be good if any CI checks that are passing on master also pass in the branch. It looks like |
jacobgkau
left a comment
There was a problem hiding this comment.
With 9f62db1 here and 5892e6b in pop-os/cosmic-settings#1860, I'm seeing archives open in File Roller even with COSMIC Files selected in Default Applications (I tried changing the setting to File Roller and then back to COSMIC Files, with no effect):
2026-02-19.16-57-09.mp4
Mmmh can you try with a different file? Like a zip file. I think it's due to a missing mime type |
|
I just tried downloading a ZIP file, and am seeing the same behavior with that (File Roller opening even though the default application is set to COSMIC Files in COSMIC Settings). |
Hi, sorry for the delay. I just checked — you need to close and reopen Cosmic Files every time you make a change. It works like other categories, such as Photos. |
9f62db1 to
f0082f8
Compare
f0082f8 to
e707adc
Compare
e707adc to
7720d0e
Compare
7720d0e to
3e61c6a
Compare
There was a problem hiding this comment.
Had some time to look at this again. Here's where we stand with this PR:
- The .desktop file lint is failing because the spec doesn't allow
NoDisplayunder individual actions. We can't simply ignore the lint because other distros have their own lints in packaging that would break if we did that. Moreover, the spec states "applications must only include actions that make sense as general launchers," so adding actions that would need to be hidden from the Applications menu wouldn't be the right approach, anyway.- Possible solutions I can think of would be using actions but implementing some kind of file-open GUI for them when launching without a filename (so they'd function if invoked from the Applications menu), or ditching the actions and instead special-casing the COSMIC Files options into COSMIC Settings.
- I'm still only getting a single
COSMIC Filesentry as a default application in Settings. So if we do stick with actions, Settings will need changing to support actions. (This could get messy with third-party apps' actions, so maybe it's not the best approach.)
All of that said, switching between COSMIC Files and other apps as the default does work as long as I restart COSMIC Files after changing the setting, as you pointed out.
Seeing as the current default behavior when double-clicking archives in COSMIC Files is the Extract to... dialog, and there's already no way to configure that, I think we could decouple the addition of allowing the direct Extract option as a default, and focus only on making the app itself configurable for now. So get rid of the actions from the .desktop file, and just make sure COSMIC Files is the default app by default, and that we show the Extract to... dialog when double-clicking archives (as we already do now) when that's the case.
Hello, thanks for the review, seems fine for me. I can do the work in about 10 days as I am not at home right now. |
|
I'm confirming with our UX team whether this solution will be acceptable for the time being, so I'll let you know before you get started on it. It looks like it might be simple enough to pare back what you've already done, so I might take a crack at it myself in the meantime as well. |
Fine, thanks. Yes it should be simple enough to adapt the PR as you described as far I remember |
… opening archives if set
43b7737 to
aa0a835
Compare
|
Reviewed the corresponding COSMIC Settings PR: pop-os/cosmic-settings#1860 (review)
I'd assume there's some kind of implicit default (or lack thereof) tripping this up. |


Change default behavior when opening archive files
fixes: #1268
Opening an archive should mean looking inside it first — extracting should be an explicit action.
Summary
This PR changes how COSMIC Files opens archive files.
Current behavior:
Problem:
Proposed behavior:
Benefits:
Conclusion:
Opening an archive now means browsing its contents first; extraction is an explicit, deliberate action.
edit: summarized