diff --git a/home/gabriel/features/desktop/common/wayland-wm/waybar.nix b/home/gabriel/features/desktop/common/wayland-wm/waybar.nix index 045d054c..37332fb4 100644 --- a/home/gabriel/features/desktop/common/wayland-wm/waybar.nix +++ b/home/gabriel/features/desktop/common/wayland-wm/waybar.nix @@ -226,7 +226,7 @@ in { }; on-click = mkScript { deps = [pkgs.handlr-regex]; - script = "handlr launch text/calendar"; + script = "handlr launch x-scheme-handler/calendar"; }; }; "custom/gpg-status" = { diff --git a/home/gabriel/features/productivity/khal.nix b/home/gabriel/features/productivity/khal.nix index b2a69e54..e4dcf365 100644 --- a/home/gabriel/features/productivity/khal.nix +++ b/home/gabriel/features/productivity/khal.nix @@ -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 = { - associations.added = { - "text/calendar" = "khal.desktop"; - }; + # pkgs.khal's desktop entry launches ikhal but declares no MIME types + associations.added."x-scheme-handler/calendar" = "khal.desktop"; defaultApplications = { - "text/calendar" = "khal.desktop"; + "text/calendar" = "khal-import.desktop"; + "x-scheme-handler/calendar" = "khal.desktop"; }; };