Format with nixfmt-rfc
This commit is contained in:
parent
8c9f699269
commit
a90a9c3a8e
60 changed files with 1756 additions and 1039 deletions
86
home/xdg.nix
86
home/xdg.nix
|
|
@ -7,39 +7,65 @@ let
|
|||
videoPlayer = [ "mpv" ];
|
||||
audioPlayer = [ "io.bassi.Amberol" ];
|
||||
|
||||
xdgAssociations = type: program: list:
|
||||
builtins.listToAttrs (map (e: {
|
||||
name = "${type}/${e}";
|
||||
value = program;
|
||||
}) list);
|
||||
xdgAssociations =
|
||||
type: program: list:
|
||||
builtins.listToAttrs (
|
||||
map (e: {
|
||||
name = "${type}/${e}";
|
||||
value = program;
|
||||
}) list
|
||||
);
|
||||
|
||||
image = xdgAssociations "image" imageViewer [ "png" "svg" "jpeg" "gif" ];
|
||||
video = xdgAssociations "video" videoPlayer [ "mp4" "avi" "mkv" ];
|
||||
audio = xdgAssociations "audio" audioPlayer [ "mp3" "flac" "wav" "aac" ];
|
||||
browserTypes = (xdgAssociations "application" browser [
|
||||
"json"
|
||||
"x-extension-htm"
|
||||
"x-extension-html"
|
||||
"x-extension-shtml"
|
||||
"x-extension-xht"
|
||||
"x-extension-xhtml"
|
||||
]) // (xdgAssociations "x-scheme-handler" browser [
|
||||
"about"
|
||||
"ftp"
|
||||
"http"
|
||||
"https"
|
||||
"unknown"
|
||||
]);
|
||||
image = xdgAssociations "image" imageViewer [
|
||||
"png"
|
||||
"svg"
|
||||
"jpeg"
|
||||
"gif"
|
||||
];
|
||||
video = xdgAssociations "video" videoPlayer [
|
||||
"mp4"
|
||||
"avi"
|
||||
"mkv"
|
||||
];
|
||||
audio = xdgAssociations "audio" audioPlayer [
|
||||
"mp3"
|
||||
"flac"
|
||||
"wav"
|
||||
"aac"
|
||||
];
|
||||
browserTypes =
|
||||
(xdgAssociations "application" browser [
|
||||
"json"
|
||||
"x-extension-htm"
|
||||
"x-extension-html"
|
||||
"x-extension-shtml"
|
||||
"x-extension-xht"
|
||||
"x-extension-xhtml"
|
||||
])
|
||||
// (xdgAssociations "x-scheme-handler" browser [
|
||||
"about"
|
||||
"ftp"
|
||||
"http"
|
||||
"https"
|
||||
"unknown"
|
||||
]);
|
||||
|
||||
# XDG MIME types
|
||||
associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) ({
|
||||
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ];
|
||||
"text/html" = browser;
|
||||
"text/plain" = [ "neovide" ];
|
||||
"x-scheme-handler/chrome" = [ "com.brave.browser" ];
|
||||
"inode/directory" = [ "yazi" ];
|
||||
} // image // video // audio // browserTypes);
|
||||
in {
|
||||
associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) (
|
||||
{
|
||||
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf" ];
|
||||
"text/html" = browser;
|
||||
"text/plain" = [ "neovide" ];
|
||||
"x-scheme-handler/chrome" = [ "com.brave.browser" ];
|
||||
"inode/directory" = [ "yazi" ];
|
||||
}
|
||||
// image
|
||||
// video
|
||||
// audio
|
||||
// browserTypes
|
||||
);
|
||||
in
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue