From ad05443e04648dca047e43090856ef9de79fbe25 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Sun, 5 Sep 2021 14:19:37 -0300 Subject: [PATCH] kitty: add onChange configuration reload --- modules/programs/kitty.nix | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index df794860d..3369b1319 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -110,24 +110,29 @@ in { home.packages = [ pkgs.kitty ] ++ optionalPackage cfg.font; - xdg.configFile."kitty/kitty.conf".text = '' - # Generated by Home Manager. - # See https://sw.kovidgoyal.net/kitty/conf.html + xdg.configFile."kitty/kitty.conf" = { + onChange = '' + ${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true + ''; + text = '' + # Generated by Home Manager. + # See https://sw.kovidgoyal.net/kitty/conf.html - ${optionalString (cfg.font != null) '' - font_family ${cfg.font.name} - ${optionalString (cfg.font.size != null) - "font_size ${toString cfg.font.size}"} - ''} + ${optionalString (cfg.font != null) '' + font_family ${cfg.font.name} + ${optionalString (cfg.font.size != null) + "font_size ${toString cfg.font.size}"} + ''} - ${toKittyConfig cfg.settings} + ${toKittyConfig cfg.settings} - ${toKittyKeybindings cfg.keybindings} + ${toKittyKeybindings cfg.keybindings} - ${toKittyEnv cfg.environment} + ${toKittyEnv cfg.environment} - ${cfg.extraConfig} - ''; + ${cfg.extraConfig} + ''; + }; xdg.configFile."kitty/macos-launch-services-cmdline" = mkIf (cfg.darwinLaunchOptions != null) {