summaryrefslogtreecommitdiff
path: root/notesplain
diff options
context:
space:
mode:
Diffstat (limited to 'notesplain')
-rwxr-xr-xnotesplain10
1 files changed, 7 insertions, 3 deletions
diff --git a/notesplain b/notesplain
index c69b903..3249258 100755
--- a/notesplain
+++ b/notesplain
@@ -1,5 +1,9 @@
#!/bin/sh
-dir="$HOME/.obsidian"
-file="$(ls -l "$dir" | awk '{print $9}' | sed 's/.md//g' | dmenu -l 30)"
-[ -n "$file" ] && batcat "$dir/$file.md"
+dir="$OBSIDIAN_HOME"
+file="$(ls -1 "$dir" | sed 's/\.md$//' | dmenu -l 30 -p 'Select note:')"
+
+if [ -n "$file" ]; then
+ tmpfile="$(mktemp /tmp/"$file"_XXXXXXXX.pdf)"
+ pandoc "$dir/$file.md" -o "$tmpfile" && zathura "$tmpfile" &
+fi