aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <chaffinach+git@protonmail.ch>2022-04-03 15:27:49 +0100
committerMatthew Lemon <chaffinach+git@protonmail.ch>2022-04-03 15:27:49 +0100
commit1f237d1ed24279b595489d02a37d4ef61a71cd8b (patch)
treec6a6d5cc2701f71114f9d9dfd1bccd7f4fc99b95
parenta5471c6471564d66fef1b9fd1db2bbb4c4f5a14a (diff)
basic lem script and revised batnote to include two new zet dirs
-rwxr-xr-xbatnote12
-rwxr-xr-xlem14
2 files changed, 23 insertions, 3 deletions
diff --git a/batnote b/batnote
index 903e3c4..d8db541 100755
--- a/batnote
+++ b/batnote
@@ -7,8 +7,16 @@ NOTES=/home/$USER/Notes
FZF_BIN=/home/$USER/.fzf/bin/fzf
BAT=/usr/bin/bat
LESS=/usr/bin/less
+VIM=/usr/bin/vim
+
CMD=$LESS
+# instead of viewing with less, we want to edit in Vim
+if [[ $1 = "-v" ]]
+then
+ CMD=$VIM
+fi
+
# if [[ -z $1 ]]; then
# echo "You must provide a file name as the argument to this command."
# exit 1
@@ -24,6 +32,8 @@ fi
if [[ -x $BAT ]]; then
CMD=$BAT
fi
-$CMD "$(find $NOTES|$FZF_BIN)"
+# Thanks to https://stackoverflow.com/a/1489405 for the find command to omit .git
+$CMD "$(find $NOTES -name '.git*' -type d -prune -o -type f -print|$FZF_BIN)"
+
diff --git a/lem b/lem
index 1fb332b..5c4fb9f 100755
--- a/lem
+++ b/lem
@@ -1,11 +1,21 @@
#!/bin/bash
NOTES=/home/$USER/Notes
-MOD_NOTES=$NOTES/mod
+TARGET_DIR=$NOTES/homezet
VIM=/usr/bin/vim
+if [[ "$1" = "-m" ]]; then
+ msg="${*:2}"
+ TARGET_DIR=$NOTES/modzet
+ shift
+else
+ msg="$@"
+ shift
+fi
+
+
STAMP="$(date +%G%m%d%H%M%S)"
-F_PATH="$MOD_NOTES/$STAMP - $@.md"
+F_PATH="$TARGET_DIR/$STAMP-$msg.md"
echo $F_PATH
$VIM "$F_PATH"