Преглед на файлове

allow to optionally pass arguments to fzf

Noah Vogt преди 1 година
родител
ревизия
9421ee6e80
променени са 3 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 7 0
      README.md
  2. 2 0
      config/default_config.py
  3. 2 1
      input/slide_selection_iterator.py

+ 7 - 0
README.md

@@ -278,6 +278,13 @@ RCLONE_LOCAL_DIR = "/home/billy/Documents/songrepo"
 
 Here an example of how to setup the rclone variables. `RCLONE_REMOTE_DIR` sets the rclone remote directory in the typical rclone format and `RCLONE_LOCAL_DIR` is the local directory on your machine that rclone syncs to. For more information, please check the [rclone documentation](https://rclone.org/docs/).
 
+#### fzf Arguments
+
+```python
+FZF_ARGS = "-i"
+```
+
+Pass commandline arguments to the fuzzy finder [fzf](https://github.com/junegunn/fzf). The example invokes the option for matching case-insensitive. By default, no arguments are passed to fzf.
 
 #### SSync Cache
 

+ 2 - 0
config/default_config.py

@@ -79,6 +79,8 @@ METADATA_STRINGS = ("title", "book", "text", "melody", "structure")
 RCLONE_REMOTE_DIR = ""
 RCLONE_LOCAL_DIR = ""
 
+FZF_ARGS = ""
+
 SSYNC_CACHE_DIR = ""
 SSYNC_CHECKFILE_NAMING = "slidegen-checkfile.txt"
 SSYNC_CACHEFILE_NAMING = "slidegen-cachefile.txt"

+ 2 - 1
input/slide_selection_iterator.py

@@ -53,8 +53,9 @@ def slide_selection_iterator(
             break
 
         os.system(
-            "cd {} && fzf > {}".format(
+            "cd {} && fzf {} > {}".format(
                 rclone_local_dir,
+                const.FZF_ARGS,
                 os.path.join(
                     const.SSYNC_CACHE_DIR, const.SSYNC_CHOSEN_FILE_NAMING
                 ),