mirror of
https://github.com/RyanGreenup/cadmus.git
synced 2025-09-02 10:23:42 +02:00
Can Now Call Find From the Terminal
This commit is contained in:
17
cadmus
17
cadmus
@@ -17,10 +17,9 @@ IFS=$'\t\n' # Split on newlines and tabs (but not on spaces)
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
[[ -z "${1:-}" ]] && mainHelp
|
|
||||||
setvars
|
setvars
|
||||||
|
[[ -z "${1:-}" ]] && mainHelp
|
||||||
arguments "${@:-}"
|
arguments "${@:-}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setvars() {
|
function setvars() {
|
||||||
@@ -30,7 +29,8 @@ function setvars() {
|
|||||||
readonly TERMINAL="kitty"
|
readonly TERMINAL="kitty"
|
||||||
readonly TERMINAL_EXEC='kitty -- '
|
readonly TERMINAL_EXEC='kitty -- '
|
||||||
readonly NOTES_DIR="$HOME/Notes"
|
readonly NOTES_DIR="$HOME/Notes"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mainHelp() {
|
function mainHelp() {
|
||||||
@@ -99,9 +99,8 @@ function NoteFind() {
|
|||||||
## sk --ansi -i -c 'rg -l -t markdown "{}"' --preview "mdcat {}" \
|
## sk --ansi -i -c 'rg -l -t markdown "{}"' --preview "mdcat {}" \
|
||||||
## --bind pgup:preview-page-up,pgdn:preview-page-down
|
## --bind pgup:preview-page-up,pgdn:preview-page-down
|
||||||
|
|
||||||
echo "${1:-}"
|
bash ""$script_dir"/NoteFind.sh" "${@:-}" ## TODO (2.) is related; do we call it this way?
|
||||||
## bash ./NoteFind.sh
|
## TODO 4. Currently this only works if called from the current directory
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mytest() {
|
mytest() {
|
||||||
@@ -127,11 +126,11 @@ Help () {
|
|||||||
main "${@}"
|
main "${@}"
|
||||||
|
|
||||||
# cursor: 33 del
|
# cursor: 33 del
|
||||||
## TODO Should interactive elements of scripts be preserved and use the clipboard
|
## TODO 1. Should interactive elements of scripts be preserved and use the clipboard
|
||||||
## As opposed to having no feedback and just operating on STDIN and STDOUT.
|
## As opposed to having no feedback and just operating on STDIN and STDOUT.
|
||||||
## Could a similar effect be acheived using /tmp or /dev/shm?
|
## Could a similar effect be acheived using /tmp or /dev/shm?
|
||||||
## TODO Should subscripts be exptected to be relative or absolute?
|
## TODO 2. Should subscripts be exptected to be relative or absolute?
|
||||||
## TODO Should the Notes directory be a global variable or an argument
|
## TODO 3. Should the Notes directory be a global variable or an argument
|
||||||
## TODO Should we set the Notes directory in a TOML?
|
## TODO Should we set the Notes directory in a TOML?
|
||||||
## https://github.com/freshautomations/stoml
|
## https://github.com/freshautomations/stoml
|
||||||
## TODO
|
## TODO
|
||||||
|
Reference in New Issue
Block a user