From 33171e44fc746e7719e775e332bebb0248788c26 Mon Sep 17 00:00:00 2001 From: Bryan Jenks Date: Mon, 25 May 2020 21:21:02 -0700 Subject: [PATCH] fully resolves #27 and extention to it --- flash | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/flash b/flash index 114f72e..11ef7ff 100755 --- a/flash +++ b/flash @@ -24,9 +24,10 @@ #==============================================================# # USER CUSTOMIZABLE VARIABLES - CARD_POOL_SIZE=10 # How large the pool size is for shuf to draw from - SEARCH_DEPTH=999 # How many levels to recursively search for .csv's in .local/share/flash - PREVIEWER='bat' # What fzf previewer to use when searching through decks + CARD_POOL_SIZE=10 ######## How large the pool size is for shuf to draw from + SEARCH_DEPTH=999 ######### How many levels to recursively search for .csv's in .local/share/flash + PREVIEWER='bat' ########## What fzf previewer to use when searching through decks + CURR_DECK_DISPLAY="file" # Options are 'file' or 'path' # ANSI FOREGROUND ESCAPE COLORS RED='\033[0;31m' @@ -221,7 +222,14 @@ done DECK="$(find . -maxdepth "$SEARCH_DEPTH" -iname "*.csv" | fzf --preview="$PREVIEWER $PREVIEWER_PARAMTERS {} | head -500")" # Get current deck name for display -CURRENT_DECK="$(echo "$DECK" | awk -F/ '{print $NF}')" +case "$CURR_DECK_DISPLAY" in + file) CURRENT_DECK="$(echo "$DECK" | awk -F/ '{print $NF}')" ;; + path) CURRENT_DECK="$DECK" ;; + *) CURRENT_DECK="$(echo "$DECK" | awk -F/ '{print $NF}')" ;; +esac + + + # If no deck is selected in fzf menu # return user to start location