From f19453f25a04b0760ff1303388d136a8b60c2c04 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 26 Nov 2026 11:10:41 +0100 Subject: feat(mimeapps): a Default apps settings page Shows and sets the default application per file type in mimeapps.list: role rows that set a group of types at once, every explicit entry with Change and Remove, and a search to add any type an installed app declares. The picker offers the apps whose .desktop declares the type, from one grep over the XDG applications dirs, since DesktopEntry has no mimeTypes; or every app on request. No write before the first read, so a click during load cannot replace the file with one line. Stale entries, whose app DesktopEntries does not know, show their id in red. Co-Authored-By: Claude Sonnet 5.5 --- desktop/modules/mimeapps/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 desktop/modules/mimeapps/README.md (limited to 'desktop/modules/mimeapps/README.md') diff --git a/desktop/modules/mimeapps/README.md b/desktop/modules/mimeapps/README.md new file mode 100644 index 0000000..e63b7bb --- /dev/null +++ b/desktop/modules/mimeapps/README.md @@ -0,0 +1,27 @@ +# mimeapps + +The settings window's **Default apps** page: the default application per +file type, from `$XDG_CONFIG_HOME/mimeapps.list` (the file `xdg-mime` and +`xdg-open` read). + +- **Roles**: Browser, Mail, Text, PDF, Image, Video, Audio, Files, Archive. + Each sets its whole group of types (`ROLES` in `MimeApps.js`) at once and + shows the app most of them point at, or how many apps when they disagree. +- **Explicit**: every `[Default Applications]` entry, with Change and + Remove. An entry whose app is not installed shows its id in red. +- **Add**: search any type an installed app declares; it is written once an + app is picked. + +The picker lists the apps whose `.desktop` declares the type (one `grep` over +the XDG applications directories, since Quickshell's `DesktopEntry` has no +`mimeTypes`), or every app with "Show all apps". + +Only `[Default Applications]` is edited; `[Added Associations]`, comments and +other sections are left as they are. Not handled: system-wide and +desktop-specific `mimeapps.list` files. + +The file is written directly rather than through `xdg-mime default`, which +cannot remove an entry. `DesktopEntry.id` has no `.desktop` suffix while +mimeapps.list ids do, so lookups strip it. + +Test: `node desktop/modules/mimeapps/test_mimeapps.js`. -- cgit v1.2.3