vanadium: improve browser xdg configuration

This commit is contained in:
Primrose 2025-11-26 15:12:24 +08:00
parent 4c4ed165b3
commit 1bec3a93a0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 18 additions and 25 deletions

View file

@ -140,7 +140,7 @@ in
"x-scheme-handler/unknown" = "firefox.desktop"; "x-scheme-handler/unknown" = "firefox.desktop";
}; };
in in
lib.mkIf cfg.enable { lib.mkIf (cfg.enable && !config.programs.zen-browser.enable) {
enable = true; enable = true;
associations.added = associations; associations.added = associations;
defaultApplications = associations; defaultApplications = associations;

View file

@ -134,30 +134,23 @@ in
xdg.mimeApps = xdg.mimeApps =
let let
associations = builtins.listToAttrs ( associations = lib.genAttrs [
map "application/x-extension-shtml"
(name: { "application/x-extension-xhtml"
inherit name; "application/x-extension-html"
value = cfg.package.meta.desktopFileName; "application/x-extension-xht"
}) "application/x-extension-htm"
[ # "x-scheme-handler/unknown"
"application/x-extension-shtml" # "x-scheme-handler/mailto"
"application/x-extension-xhtml" "x-scheme-handler/chrome"
"application/x-extension-html" "x-scheme-handler/about"
"application/x-extension-xht" "x-scheme-handler/https"
"application/x-extension-htm" "x-scheme-handler/http"
"x-scheme-handler/unknown" "application/xhtml+xml"
"x-scheme-handler/mailto" # "application/json"
"x-scheme-handler/chrome" # "text/plain"
"x-scheme-handler/about" "text/html"
"x-scheme-handler/https" ] (_: cfg.package.meta.desktopFileName);
"x-scheme-handler/http"
"application/xhtml+xml"
"application/json"
"text/plain"
"text/html"
]
);
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
associations.added = associations; associations.added = associations;