aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/mimeapps/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-26 11:10:41 +0100
committerDanilo M. <danix@danix.xyz>2026-11-26 11:10:41 +0100
commitf19453f25a04b0760ff1303388d136a8b60c2c04 (patch)
tree140f0e436fe9f94e325b0fa3fd34b95d1b362457 /desktop/modules/mimeapps/README.md
parent3fe5cf3fcadd836b1b50efbb32f628044ad63e9f (diff)
downloadquickshell-f19453f25a04b0760ff1303388d136a8b60c2c04.tar.gz
quickshell-f19453f25a04b0760ff1303388d136a8b60c2c04.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/mimeapps/README.md')
-rw-r--r--desktop/modules/mimeapps/README.md27
1 files changed, 27 insertions, 0 deletions
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`.