Add some more mime-types and improve query func

This commit is contained in:
Evie Litherland-Smith 2023-09-13 19:57:39 +01:00
parent 708cb4c97f
commit 7fa4a0b898
2 changed files with 17 additions and 10 deletions

View file

@ -51,16 +51,19 @@
"hypr/macchiato.conf".source = ./macchiato.conf;
"hypr/extra.conf" = lib.mkDefault { text = ""; };
};
mimeApps = {
mimeApps = let
associations = {
"image/jpeg" = [ "swayimg.desktop" ];
"image/png" = [ "swayimg.desktop" ];
"application/pdf" = [ "zathura.desktop" "emacs.desktop" ];
"application/json" = [ "emacs.desktop" "firefox.desktop" ];
"application/x-yaml" = [ "emacs.desktop" ];
"text/csv" = [ "calc.desktop" "emacs.desktop" ];
};
in {
enable = true;
defaultApplications = {
"image/jpeg" = [ "swayimg.desktop" ];
"image/png" = [ "swayimg.desktop" ];
};
associations.added = {
"image/jpeg" = [ "swayimg.desktop" ];
"image/png" = [ "swayimg.desktop" ];
};
defaultApplications = associations;
associations.added = associations;
};
};
}

View file

@ -15,7 +15,11 @@
source ${catppuccin-themes.zsh}
'';
initExtra = ''
xdg-query-program () { xdg-mime query default $(xdg-mime query filetype $@) }
xdg-query-program () {
FILETYPE=$(xdg-mime query filetype $@)
DEFAULT=$(xdg-mime query default $FILETYPE)
echo "$FILETYPE -> $DEFAULT"
}
'';
oh-my-zsh = {
enable = true;