aboutsummaryrefslogtreecommitdiff
path: root/public/.local/bin/dmenu-openbook.sh
diff options
context:
space:
mode:
Diffstat (limited to 'public/.local/bin/dmenu-openbook.sh')
-rwxr-xr-xpublic/.local/bin/dmenu-openbook.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/public/.local/bin/dmenu-openbook.sh b/public/.local/bin/dmenu-openbook.sh
index 6a257c7..e5766d5 100755
--- a/public/.local/bin/dmenu-openbook.sh
+++ b/public/.local/bin/dmenu-openbook.sh
@@ -1,5 +1,10 @@
#!/bin/bash
# xdg-open a file selected through dmenu
+# TODO: merge dmenu-open* into dmenu-open.sh, call it with 1 argument:
+# `dmenu-open.sh books|spreadsheet`
+# `dmenu-open.sh` with no arguments opens a preliminary dmenu to select
+# the category (base directory) from a list. Each category is defined by
+# a path and white-listed file extensions.
path="$HOME/docs/books"
@@ -13,6 +18,6 @@ cd $path
files=$(find . -type f \( -iname "*.pdf" -o -iname "*.epub" \))
selected=$(echo "$files" | dmenu -i -l 20 -p "Select book:")
if [ -n "$selected" ]; then
- xdg-open "$selected"
+ xdg-open "$selected" &
notify
fi