diff options
Diffstat (limited to 'bin/menuscripts/tsh')
| -rwxr-xr-x | bin/menuscripts/tsh | 21 | 
1 files changed, 7 insertions, 14 deletions
diff --git a/bin/menuscripts/tsh b/bin/menuscripts/tsh index aac27ee..0c57ee0 100755 --- a/bin/menuscripts/tsh +++ b/bin/menuscripts/tsh @@ -5,8 +5,8 @@ PROG="$(basename "$0")"  # copy command and deps variable  deps="pup curl $MENUCMD" -LIBPFX=/home/aluc/.local/share/tsh -module='1337x.sh' # default module +MODULES_PATH=$HOME/.local/share/tsh +module='nyaa.sh' # default module  # Files  export tmp="/tmp/$PROG" @@ -83,7 +83,7 @@ cleanup ()  	done  } -list_modules () { find -L "$LIBPFX" -type f -printf "%f\n"; } +list_modules () { find -L "$MODULES_PATH" -type f -printf "%f\n"; }  # get a query from user based on MENUCMD  get_query () @@ -121,14 +121,6 @@ show_files()  	rm -f "$tmp"/.torrent  } -# Select a type after having displayed them with 'show_types' -select_type() -{ -	for type in $categories -	do printf "%s\n" "$type" -	done | fzf -} -  trap "exit 1" INT  trap "cleanup" EXIT @@ -179,7 +171,7 @@ then  	# Get results  	rm -f "$results" "$links"  	# shellcheck source=/usr/local/lib/$PROG/nyaa.sh disable=SC1091 -	. "$LIBPFX/$module" +	. "$MODULES_PATH/$module"  	[ -f "$results" ] || die "No results."  	# Save which module was used @@ -190,7 +182,7 @@ fi  # acquire get_magnet function  # shellcheck source=/usr/local/lib/$PROG/nyaa.sh disable=SC1091 -getfunctions=1 . "$LIBPFX/$module" +getfunctions=1 . "$MODULES_PATH/$module"  # select result from "$results"  for choice in $(select_result | xargs) @@ -205,7 +197,8 @@ do      if [ "$noaskdownload" ] || confirm 'download?'      then -    	    [ "${category:-$(select_type)}" ] || exit 1 +    	    [ "$category" ] || category="$(printf '%s' "$categories" | tr ' ' '\n' | fzf)" +    	    [ "$category" ] || exit 2  	    transmission-remote debuc.com -a "$magnet" -w "/downloads/$category"      elif confirm "copy?"      then  | 
