From e8c5a10df7ac2bae9a0432d10b65478727ba0438 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:14:57 -0500 Subject: [PATCH] attempt to set default apps for xdg-open --- modules/applications/media.nix | 21 +++++++++++++++------ modules/applications/nautilus.nix | 4 ++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/applications/media.nix b/modules/applications/media.nix index c2a1620..84fe7eb 100644 --- a/modules/applications/media.nix +++ b/modules/applications/media.nix @@ -10,12 +10,21 @@ }; config = lib.mkIf (config.gui.enable && config.media.enable) { - home-manager.users.${config.user}.home.packages = with pkgs; [ - mpv # Video viewer - sxiv # Image viewer - mupdf # PDF viewer - zathura # PDF viewer - ]; + home-manager.users.${config.user} = { + home.packages = with pkgs; [ + mpv # Video viewer + sxiv # Image viewer + mupdf # PDF viewer + zathura # PDF viewer + ]; + + # Set default for opening PDFs + xdg.mimeApps.defaultApplications."application/pdf" = + [ "zathura.desktop" ]; + xdg.mimeApps.defaultApplications."image/*" = [ "sxiv.desktop" ]; + + }; + }; } diff --git a/modules/applications/nautilus.nix b/modules/applications/nautilus.nix index 3c81b0b..d8610e6 100644 --- a/modules/applications/nautilus.nix +++ b/modules/applications/nautilus.nix @@ -17,6 +17,10 @@ gnome.sushi # Quick preview with spacebar ]; + # Set default for opening directories + xdg.mimeApps.defaultApplications."inode/directory" = + [ "nautilus.desktop" ]; + programs.fish.functions = { qr = { body =