mirror of
https://github.com/RyanGreenup/cadmus.git
synced 2025-08-20 12:51:29 +02:00
Set up Tags, they're janky but they do work
This commit is contained in:
19
bin/cadmus
19
bin/cadmus
@@ -135,21 +135,7 @@ function NoteSearch() {
|
|||||||
|
|
||||||
## Only try and open something that is non-empty
|
## Only try and open something that is non-empty
|
||||||
if [ "$FILES" != "" ]; then
|
if [ "$FILES" != "" ]; then
|
||||||
## xdg-open doesn't accept multiple arguments, so create commands and
|
|
||||||
## pipe them back into bash This opens all files in the same tab with
|
|
||||||
## VSCode and Atom The individual selections can also be passed off with
|
|
||||||
## the keybindings to emacsclient.
|
|
||||||
# Using XDG-OPEN
|
|
||||||
# echo "${FILES}" | sed s/^/xdg-open\ \"/ | sed s/$/\"/ | bash
|
|
||||||
echo "${FILES}" | sed -e s+^+\"+ -e s+$+\"+ | xargs -n 1 xdg-open
|
echo "${FILES}" | sed -e s+^+\"+ -e s+$+\"+ | xargs -n 1 xdg-open
|
||||||
|
|
||||||
# # Getting the .desktop file and cutting off the Extension
|
|
||||||
# dex "$(xdg-mime query default text/markdown)" $FILES
|
|
||||||
# dex "$(xdg-mime query default text/markdown)" $FILES
|
|
||||||
## This might break if the .desktop file doesn't have the same
|
|
||||||
## name as the binary.
|
|
||||||
## This appears to be a standard though
|
|
||||||
## https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#file-naming
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,9 +148,10 @@ CadmusTags () {
|
|||||||
while test $# -gt 0
|
while test $# -gt 0
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
filter) shift; NoteFind "${NOTES_DIR}" "${@:-}"
|
filter) shift; "${script_dir}/tags/FilterNotesByTMSUTag.sh" "${NOTES_DIR}" "${@:-}"
|
||||||
;;
|
;;
|
||||||
create) shift; tags-to-TMSU.sh "${NOTES_DIR}" ${@:-} && exit 0
|
create) shift; "${script_dir}/tags/tags-to-TMSU.sh" "${NOTES_DIR}" ${@:-} && exit 0
|
||||||
|
./
|
||||||
;;
|
;;
|
||||||
--*) >&2 echo "bad option $1"
|
--*) >&2 echo "bad option $1"
|
||||||
;;
|
;;
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
readonly script_name=$(basename "${0}")
|
||||||
|
readonly script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
readonly NOTES_DIR="$HOME/Notes/MD/notes"
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ r :: regenerate Tags"
|
|||||||
read -d '' -s -n1 continueQ
|
read -d '' -s -n1 continueQ
|
||||||
|
|
||||||
if [ "$continueQ" == "r" ]; then
|
if [ "$continueQ" == "r" ]; then
|
||||||
~/bin/tags-to-TMSU.sh
|
"${script_dir}/tags-to-TMSU.sh" "${NOTES_DIR}" ${@:-} && exit 0
|
||||||
exit 0 ## Must Exit because it won't find the tags without restarting.
|
exit 0 ## Must Exit because it won't find the tags without restarting.
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
3
todo.org
3
todo.org
@@ -66,6 +66,9 @@ Take the command query and change white spaces into =|= characters, this way sea
|
|||||||
* TODO [#A] tags
|
* TODO [#A] tags
|
||||||
** TODO Standardise
|
** TODO Standardise
|
||||||
These desperately need to be standardised like search and NoteFind have been
|
These desperately need to be standardised like search and NoteFind have been
|
||||||
|
** TODO Move the scripts into PATH
|
||||||
|
Currently all the tag scripts call a relative script, not in the PATH, maybe this is actually OK? it means 0 install...
|
||||||
|
|
||||||
* TODO [#A] tools
|
* TODO [#A] tools
|
||||||
** Link Markdown Notes
|
** Link Markdown Notes
|
||||||
Should this do grep or recoll?
|
Should this do grep or recoll?
|
||||||
|
Reference in New Issue
Block a user