feat(home/calendar): split import and viewer handlers

Add khal-import.desktop for interactive text/calendar imports. Associate
pkgs.khal's existing khal.desktop, which launches ikhal, with
x-scheme-handler/calendar and use that handler from Waybar.

Assisted-by: pi (gpt-5.6-sol)
This commit is contained in:
Gabriel Fontes
2026-08-16 12:13:40 -03:00
parent 8633ecf494
commit c660195792
2 changed files with 18 additions and 6 deletions
@@ -226,7 +226,7 @@ in {
}; };
on-click = mkScript { on-click = mkScript {
deps = [pkgs.handlr-regex]; deps = [pkgs.handlr-regex];
script = "handlr launch text/calendar"; script = "handlr launch x-scheme-handler/calendar";
}; };
}; };
"custom/gpg-status" = { "custom/gpg-status" = {
+17 -5
View File
@@ -1,11 +1,23 @@
{ {
# Set as default calendar handler config,
lib,
...
}: {
# Import calendar files interactively in a terminal
xdg.desktopEntries.khal-import = {
name = "Import calendar event";
exec = "${lib.getExe' config.programs.khal.package "khal"} import %f";
terminal = true;
noDisplay = true;
mimeType = ["text/calendar"];
};
xdg.mimeApps = { xdg.mimeApps = {
associations.added = { # pkgs.khal's desktop entry launches ikhal but declares no MIME types
"text/calendar" = "khal.desktop"; associations.added."x-scheme-handler/calendar" = "khal.desktop";
};
defaultApplications = { defaultApplications = {
"text/calendar" = "khal.desktop"; "text/calendar" = "khal-import.desktop";
"x-scheme-handler/calendar" = "khal.desktop";
}; };
}; };