diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2026-02-28 21:53:11 +0200 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2026-02-28 21:53:11 +0200 |
| commit | c1e651d6be2ae6ba8ef903ad8821f4af4d010873 (patch) | |
| tree | 6d2c951d49ade71bbcce2e6b0fdd71144761be67 /config_cmd.h.in | |
| parent | 0fd8238bda5a40cb72e814c6cc820bd71e044261 (diff) | |
| parent | 67a1c24a8661fdcbc48f72f7b65521772065d305 (diff) | |
Merge branch 'bulk-rename'
Diffstat (limited to 'config_cmd.h.in')
| -rw-r--r-- | config_cmd.h.in | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/config_cmd.h.in b/config_cmd.h.in index 5891957..3802760 100644 --- a/config_cmd.h.in +++ b/config_cmd.h.in @@ -25,7 +25,31 @@ // CMD_FILE_CURSOR = Ignore marks and add the name under the cursor to input. // CMD_EXEC_MARK = Skip interactive prompt only if marks exist.. // CMD_EXEC_ROOT = Skip interactive prompt even if root. -// +!! +## Shell cript can be embedded within dfm by using the embed command. +## The script will be run in $SHELL as the argument following '-c'. +## +## FM_CMD(cmd_bulk_rename, +## .prompt = CUT_NULL, +## .left = CUT($(embed script/bulk-rename)), +## .enter = fm_cmd_run_sh, +## .config = CMD_MARK_DIR | CMD_MUT | CMD_EXEC, +## ) +## +## Another useful example is embedding your opener script. +## +## FM_CMD(cmd_opener, +## .prompt = CUT_NULL, +## .left = CUT($(embed script/opener_ext)), +## .enter = fm_cmd_run_sh, +## .config = CMD_MARK_DIR | CMD_EXEC, +## ) +## +## Shell can also be typed directly but its cumbersone to add \\n to the end of +## each line and escape backslashes and double quotes. +## +## .left = CUT("echo \\"$@\\"\\n"), +!! // If the FM_CMD system is too limiting you can define your own functions and // bind them to keys. The same function signature is used in navigation and // input modes. @@ -154,3 +178,10 @@ FM_CMD(cmd_trash, .config = CMD_MARK_DIR | CMD_MUT | CMD_EXEC_MARK, ) +FM_CMD(cmd_bulk_rename, + .prompt = CUT_NULL, + .left = CUT($(embed script/bulk-rename)), + .enter = fm_cmd_run_sh, + .config = CMD_MARK_DIR | CMD_MUT | CMD_EXEC, +) + |