From 015d08005df386845e896bc38c48dc284ce7c336 Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Sun, 6 Mar 2022 09:17:56 -0800 Subject: [PATCH] Add file type associations --- common/home.nix | 28 ++++++++++++++++++++++++++++ hosts/main/home.nix | 5 +++++ 2 files changed, 33 insertions(+) diff --git a/common/home.nix b/common/home.nix index 73462d8..627af9c 100644 --- a/common/home.nix +++ b/common/home.nix @@ -578,6 +578,34 @@ in }; }; + # File type associatoins + xdg.mimeApps = { + enable = true; + defaultApplications = { + # Document + "application/pdf" = "org.gnome.Evince.desktop"; + + # Image + "image/heif" = "org.gnome.eog.desktop"; + "image/jpeg" = "org.gnome.eog.desktop"; + "image/png" = "org.gnome.eog.desktop"; + "image/svg+xml" = "org.gnome.eog.desktop"; + "image/tiff" = "org.gnome.eog.desktop"; + + # Text + "application/gpx+xml" = "codium.desktop"; + "application/json" = "codium.desktop"; + "application/xml" = "codium.desktop"; + "text/html" = "codium.desktop"; + "text/markdown" = "codium.desktop"; + "text/plain" = "codium.desktop"; + + # Web + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + }; +}; + # Environment home.sessionVariables = rec { ANSIBLE_NOCOWS = true; diff --git a/hosts/main/home.nix b/hosts/main/home.nix index 544a1f3..385feba 100644 --- a/hosts/main/home.nix +++ b/hosts/main/home.nix @@ -75,6 +75,11 @@ in home.file.".mozilla/firefox/ahrdm58c.default/chrome/userChrome.css".source = ../../common/userChrome.css; home.file.".mozilla/firefox/ahrdm58c.default/persdict.dat".source = ../../common/words.txt; + # File type associatoins + xdg.mimeApps.defaultApplications = { + "application/x-ptoptimizer-script" = "hugin.desktop"; + }; + # Environment home.sessionPath = [ "$HOME/.cargo/bin" ]; home.sessionVariables.ATTACHMENTS_ENV = "/home/ak/.attachments.env";