pop-os / cosmic-settings

COSMIC Settings
GNU General Public License v3.0
165 stars 106 forks source link

Settings > System & Accounts > Default Applications #444

Open maria-komarova opened 3 months ago

maria-komarova commented 3 months ago

Default applications panel allows people to set preferences for default web browser, file browser, music applications and others.

Default apps

Figma file.

Nyxiad commented 2 months ago

I would appreciate a section for setting default applications by protocol and file extension. Instead of showing all of the available extensions and protocols to configure, I would like to start off with a blank or minimal list which the user can add to if desired through search or by scrolling a list in a dropdown. By minimal list, I mean commonly used extensions and protocols such as .PNG, .JPEG, and HTTPS://. That could make those settings less overwhelming compared to a long list of extensions and protocols that the user doesn't recognize.

bbb651 commented 2 months ago

@Nyxiad I'm working on implementing this, I agree that there should be a way to edit all all registered mime types (i.e. everything in /usr/share/mime, we don't have to deal with whether the association is by file extension, file magic or protocol, that is handled by xdg stuff), but I don't agree on the design:

I think it should look exactly like the design above for the very common associations people would want to change, these should be very accessible, and their naming and order is important - having it empty by default will make for a very bad experience for people not familiar with computers, and slower in general because you first have to process that there is a dropdown, then look for the common types mixed with all the uncommon types (they can be first in the list but it's still more options). Then below it (potentially under an "advanced" nested page), there should be a filterable by search list with all associations (this is more for the technical reason that on a typical system you'll already have dozens of associations even if you didn't add them in the settings, check your ~/.config/mimeapps.list under [Default Applications], it's not going to be minimal either way) both their xdg name, and their mime type next to it in smaller/thinner/grayer text both for advanced users and to further differentiate them from the common file types.

bbb651 commented 2 months ago

To illustrate what I mean, here's most of the ui:

image

Also is there currently a way in libcosmic to display views in the placeholder and dropdown list? pick_list, dropdown and combo_box all only support displaying strings...

Also for the actual implementation, using the xdg-mime crate is fine right? Also I'm not sure I entirely understand the separation between cosmic-settings and cosmic-settings-daemon, because some of the logic seems to here in cosmic-settings, should things be in the daemon only if they're potentially useful for applets?

wiiznokes commented 2 months ago

I was wondering, how the default terminal is implemented ?

mmstick commented 2 months ago

xdg-terminal-exec, and on Debian systems there's also update-alternatives --config x-terminal-emulator.

M00NJ commented 1 month ago

I think a document reader should be added to the list, as it's used frequently and since one is already in the works. The proposed approach to select default applications per mime type is a nice suggestion as well. Though I'd argue a document reader is such a common application, that it warrants a spot on the list.

iamkartiknayak commented 1 month ago

Would there be an option to add extension to a type such as (.heic, .jxl) to image type if not configured by default?