Fix mime-apps

This commit is contained in:
ItsDrike 2024-06-21 13:58:42 +02:00
parent e4c3ae78ff
commit 05278242fe
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -1,43 +1,60 @@
# Manage $XDG_CONFIG_HOME/mimeapps.list
{
xdg.mimeApps = {
enable = true;
associations.added = let
xdg.mimeApps = let
browser = "firefox.desktop";
textEditor = browser; # nvim doesn't work properly with xdg-open, just use the browser
fileManager = "pcmanfm-qt.desktop";
emailClient = browser;
pdfViewer = browser; # TODO: consider zathura (org.pwmt.zathura.desktop.desktop)
fileManager = "pcmanfm-qt.desktop"; # TODO: change
archiveManager = "org.gnome.FileRoller.desktop";
imageViewer = "org.nomacs.ImageLounge.desktop";
videoPlayer = "mpv.desktop";
audioPlayer = "mpv.desktop";
in {
"text/html" = [browser];
"x-scheme-handler/http" = [browser];
"x-scheme-handler/https" = [browser];
"x-scheme-handler/about" = [browser];
"x-scheme-handler/unknown" = [browser];
"application/x-extension-htm" = [browser];
"application/x-extension-html" = [browser];
"application/x-extension-shtml" = [browser];
"application/xhtml+xml" = [browser];
"application/x-extension-xhtml" = [browser];
"application/x-extension-xht" = [browser];
"inode/directory" = [fileManager];
"application/zip" = [archiveManager];
"application/x-xz-compressed-tar" = [archiveManager];
associations = {
"text/html" = [browser];
"x-scheme-handler/http" = [browser];
"x-scheme-handler/https" = [browser];
"x-scheme-handler/about" = [browser];
"x-scheme-handler/unknown" = [browser];
"application/x-extension-htm" = [browser];
"application/x-extension-html" = [browser];
"application/x-extension-shtml" = [browser];
"application/xhtml+xml" = [browser];
"application/x-extension-xhtml" = [browser];
"application/x-extension-xht" = [browser];
"image/*" = [imageViewer];
"audio/*" = [audioPlayer];
"video/*" = [videoPlayer];
"application/pdf" = [pdfViewer];
"x-scheme-handler/mailto" = [emailClient];
"text/plain" = [textEditor];
"application/json" = [textEditor];
"inode/directory" = [fileManager];
"application/zip" = [archiveManager];
"application/x-xz-compressed-tar" = [archiveManager];
"x-scheme-handler/spotify" = ["spotify.desktop"];
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
"x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me
};
"image/*" = [imageViewer];
"audio/*" = [audioPlayer];
"video/*" = [videoPlayer];
# The wildcard associations don't work everywhere, so we
# still need specific ones
"image/jpeg" = [imageViewer];
"image/png" = [imageViewer];
"image/svg+xml" = [imageViewer];
"image/gif" = [imageViewer];
"video/mp4" = [videoPlayer];
"text/plain" = [textEditor];
"application/json" = [textEditor];
"x-scheme-handler/spotify" = ["spotify.desktop"];
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
"x-scheme-handler/discord" = ["vesktop.desktop"];
"x-scheme-handler/msteams" = ["teams.desktop"]; # I need it for school, don't judge me
};
in {
enable = true;
associations.added = associations;
defaultApplications = associations;
};
home.sessionVariables = {