launch helix for editing desktop text files

This commit is contained in:
Noah Masur
2025-09-28 15:14:20 -04:00
parent bf52069886
commit 7543721020
2 changed files with 22 additions and 1 deletions

View File

@@ -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"$@" '')
];
};
}

View File

@@ -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"