Added sbagen helper with fzf. Still rough, but should work

master
Steven Saus 3 years ago
parent b712358a4e
commit 116c03bc6a
  1. 26
      sbagen_select.sh

@ -0,0 +1,26 @@
#!/bin/bash
##############################################################################
#
# sbagen_select
# Wrapper for searching and quickly viewing sbagen files using fzf,rg, and bat
# (c) Steven Saus 2021
# Licensed under the MIT license
#
##############################################################################
SBAGenDir="/home/steven/apps/sbagen-1.4.4/"
OGGDir="/home/steven/apps/sbagen-1.4.4/"
#SearchTerm=$(echo ${@} | sed '/^$/!s/[^ ]* */| -e &/g' | tail -c +2)
#SearchString=$(printf "rg %s -l -f $(rg --files-without-match \"_diff:\" %s)" "${SearchTerm}" "${JoplinSearchDir}")
#cat "$SearchString"
#eval "$SearchString"
#rg -l -w "${SearchTerm}" $(rg --files-without-match "title_diff:" ${JoplinSearchDir}) | fzf --no-hscroll -m --height 90% --border --ansi --no-bold --preview='bat {}'
#| rg --files-without-match -e "_diff:" -f - | fzf --no-hscroll -m --height 90% --border --ansi --no-bold --preview="bat {}"
sbgfile=$(fdfind . ${SBAGenDir} --follow --type file --extension sbg | fzf --no-hscroll -m --height 90% --border --ansi --no-bold --header="Choose SBA file" --preview='sed -n "/^#/p" {}')
oggfile=$(fdfind . ${SBAGenDir} --follow --type file --extension ogg | fzf --no-hscroll -m --height 90% --border --ansi --no-bold --header="Choose background" )
/usr/bin/xterm -e /usr/bin/padsp_32 /home/steven/apps/sbagen-1.4.4/sbagen -m "${oggfile}" "${sbgfile}" &
Loading…
Cancel
Save