clean up application URL associations, slightly

a lot of glib apps seem to struggle with http(s)://, possibly because of flatpak? so use mpv for images. no suitable option for pdfs
This commit is contained in:
2024-10-07 19:05:58 +00:00
parent 0fc169ed9b
commit 01329b2498
3 changed files with 13 additions and 9 deletions

View File

@@ -1,16 +1,7 @@
{ pkgs, ... }:
{
sane.programs.loupe = {
# loupe is marked "dbus activatable", which does not seem to actually work (at least when launching from Firefox or Nautilus)
packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.loupe;
# .overrideAttrs (upstream: {
# preFixup = (upstream.preFixup or "") + ''
# # 2024/02/21: render bug which affects only moby:
# # large images render blank in several gtk applications.
# # may resolve itself as gtk or mesa are updated.
# gappsWrapperArgs+=(--set GSK_RENDERER cairo)
# '';
# }));
sandbox.whitelistDri = true; #< faster rendering
sandbox.whitelistWayland = true;
@@ -39,6 +30,10 @@
"image/svg+xml" = "org.gnome.Loupe.desktop";
"image/webp" = "org.gnome.Loupe.desktop";
};
# XXX(2024-10-06): even with sandbox.net = "all", loupe fails to open https:// or even http:// media
# mime.urlAssociations."^https?://.*\.(gif|heif|jpeg|jpg|png|svg|webp)(\\?.*)?$" = "org.gnome.Loupe.desktop";
# mime.urlAssociations."^https?://i\.imgur.com/.+$" = "org.gnome.Loupe.desktop";
};
}

View File

@@ -242,9 +242,11 @@ in
mime.urlAssociations."^https?://(m\.)?(www\.)?youtube.com/watch\?.*v=.+$" = "mpv.desktop";
mime.urlAssociations."^https?://(m\.)?(www\.)?facebook.com/reel/.+$" = "mpv.desktop";
#v be the opener for A/V, generally. useful for e.g. feed readers like News Flash which open content through the portal
# also allows right-click -> xdg-open to open embedded videos
mime.urlAssociations."^https?://.*\.(mp3|mp4|ogg|ogv|opus|webm)(\\?.*)?$" = "mpv.desktop";
#v Loupe image viewer can't open URIs, so use mpv instead
mime.urlAssociations."^https?://i\.imgur.com/.+$" = "mpv.desktop";
mime.urlAssociations."^https?://.*\.(gif|heif|jpeg|jpg|png|svg|webp)(\\?.*)?$" = "mpv.desktop";
};
sane.programs.yt-dlp.config = lib.mkIf cfg.enabled {

View File

@@ -1,6 +1,11 @@
{ ... }:
{
sane.programs.papers = {
# packageUnwrapped = pkgs.papers.overrideAttrs (upstream: {
# # allow loading of http documents
# buildInputs = upstream.buildInputs ++ [ pkgs.glib-networking ];
# });
buildCost = 2; #< webkitgtk
sandbox.whitelistDbus = [ "user" ]; #< for clicking links
sandbox.whitelistDri = true; #< speedier
@@ -8,5 +13,7 @@
sandbox.autodetectCliPaths = "existingFile";
mime.associations."application/pdf" = "org.gnome.Papers.desktop";
# XXX(2024-10-06): even with `sandbox.net = "all"` and glib-networking, papers can only open *http* URLs and not https
# mime.urlAssociations."^https?://.*\.pdf(\\?.*)?$" = "org.gnome.Papers.desktop";
};
}