diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 02:02:23 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 03:50:32 +0530 |
| commit | 41bdeb88009dd232808edee9fc0e4ae94358d8d6 (patch) | |
| tree | c1a41f54e086064dac178ebed24d36ab34087c32 /modules/file-management/yazi/yazi-file-chooser.sh | |
| parent | 530299d97926d45939f831dc3ea5e444d2839d08 (diff) | |
| download | home-manager-config-41bdeb88009dd232808edee9fc0e4ae94358d8d6.tar.gz home-manager-config-41bdeb88009dd232808edee9fc0e4ae94358d8d6.zip | |
refactor: moving script into modules that makes sense
- instead of collecting all scripts into modules/scripts we are moving
them to modules that makes sense (yazi-file-chooser.sh into yazi)
Diffstat (limited to 'modules/file-management/yazi/yazi-file-chooser.sh')
| -rw-r--r-- | modules/file-management/yazi/yazi-file-chooser.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/file-management/yazi/yazi-file-chooser.sh b/modules/file-management/yazi/yazi-file-chooser.sh new file mode 100644 index 0000000..7978222 --- /dev/null +++ b/modules/file-management/yazi/yazi-file-chooser.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# $1 toggles multiple selection +# $2 toggles directory select mode +# $3 toggles save file mode +# $4 is the initial directory path +# $5 is the output path file + +# multiple="$1" +directory="$2" +# save="$3" +path="$4" +out="$5" + +# Pick directory vs single/multiple file +if [ "$directory" = "1" ]; then + # Outputs the final working directory path on exit + exec yazi "$path" --cwd-file="$out" +else + # Writes all selected file paths to the output file on exit + exec yazi "$path" --chooser-file="$out" +fi |
