diff --git a/platforms/home-manager/modules/nmasur/presets/programs/helix.nix b/platforms/home-manager/modules/nmasur/presets/programs/helix.nix index 3f73700..2c7e963 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/helix.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/helix.nix @@ -454,6 +454,27 @@ in }; + # Create a desktop option for launching Helix from a file manager + # (Requires launching the terminal and then executing Helix) + xdg.desktopEntries.helix = + lib.mkIf (pkgs.stdenv.isLinux && config.nmasur.presets.services.i3.enable) + { + name = "Helix wrapper"; + exec = ''sh -c "${lib.getExe config.nmasur.presets.services.i3.terminal} --command='hx \$1'" _ %F ''; # TODO: change to work for any terminal + mimeType = [ + "text/plain" + "text/markdown" + ]; + }; + xdg.mimeApps.defaultApplications = { + "text/plain" = lib.mkBefore [ "Helix.desktop" ]; + "text/markdown" = lib.mkBefore [ "Helix.desktop" ]; + }; + + home.packages = [ + (pkgs.writers.writeDashBin "xterm" ''${lib.getExe config.nmasur.presets.services.i3.terminal} +new-window --command"$@" '') + ]; + }; } diff --git a/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix b/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix index 2807e4e..924dfcd 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/neovim.nix @@ -66,7 +66,7 @@ in lib.mkIf (pkgs.stdenv.isLinux && config.nmasur.presets.services.i3.enable) { name = "Neovim wrapper"; - exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} nvim %F"; # TODO: change to generic + exec = ''${lib.getExe config.nmasur.presets.services.i3.terminal} --command="nvim %F"''; # TODO: change to generic mimeType = [ "text/plain" "text/markdown"