aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/lf
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/lf')
-rw-r--r--modules/by-name/lf/lf/commands/default.nix38
1 files changed, 13 insertions, 25 deletions
diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix
index 42508566..aa78514f 100644
--- a/modules/by-name/lf/lf/commands/default.nix
+++ b/modules/by-name/lf/lf/commands/default.nix
@@ -2,53 +2,38 @@
functionCall = {
name,
dependencies,
- ...
+ keepPath ? false,
}:
pkgs.writeShellApplication {
inherit name;
text = builtins.readFile ./base.sh + builtins.readFile ./scripts/${name}.sh;
runtimeInputs = dependencies;
+ inheritPath = keepPath;
}
+ "/bin/${name}";
# closes the lf tui
- shell = {
- name,
- dependencies,
- ...
- }: ''
+ shell = args: ''
''${{
- ${functionCall {inherit name dependencies;}}
+ ${functionCall args}
}}
'';
# runs the command in the ui/term bar
- pipe = {
- name,
- dependencies,
- ...
- }: ''
+ pipe = args: ''
%{{
- ${functionCall {inherit name dependencies;}}
+ ${functionCall args}
}}
'';
# runs the command in the background
- async = {
- name,
- dependencies,
- ...
- }: ''
+ async = args: ''
&{{
- ${functionCall {inherit name dependencies;}}
+ ${functionCall args}
}}
'';
# adds a prompt after the command has run
- wait = {
- name,
- dependencies,
- ...
- }: ''
+ wait = args: ''
!{{
- ${functionCall {inherit name dependencies;}}
+ ${functionCall args}
}}
'';
in {
@@ -97,6 +82,7 @@ in {
execute = shell {
name = "execute";
dependencies = [];
+ keepPath = true;
};
follow_link = pipe {
name = "follow_link";
@@ -118,6 +104,7 @@ in {
mk_script = shell {
name = "mk_script";
dependencies = [];
+ keepPath = true;
};
set_clipboard_path = async {
@@ -153,5 +140,6 @@ in {
view_file = async {
name = "view_file";
dependencies = with pkgs; [file];
+ keepPath = true;
};
}