aboutsummaryrefslogtreecommitdiffstats
path: root/modules/file-management/yazi/file-chooser.sh
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:45:10 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:33 +0530
commit1a39cf221e3f647df0767c88d89a54e3813e7019 (patch)
treeb3df1afb0bcc0942a364f267f993ed1a9bfb9434 /modules/file-management/yazi/file-chooser.sh
parente9e375f5f5263964fe89479a2610081000959774 (diff)
downloadhome-manager-config-1a39cf221e3f647df0767c88d89a54e3813e7019.tar.gz
home-manager-config-1a39cf221e3f647df0767c88d89a54e3813e7019.zip
refactor: adding explicit options to enable scripts
- some scripts that are not critical to the functioning of other options, can be enabled/disabled
Diffstat (limited to 'modules/file-management/yazi/file-chooser.sh')
-rw-r--r--modules/file-management/yazi/file-chooser.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/file-management/yazi/file-chooser.sh b/modules/file-management/yazi/file-chooser.sh
new file mode 100644
index 0000000..7978222
--- /dev/null
+++ b/modules/file-management/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