aboutsummaryrefslogtreecommitdiff
path: root/document-picker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'document-picker.sh')
-rwxr-xr-xdocument-picker.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/document-picker.sh b/document-picker.sh
new file mode 100755
index 0000000..c6509c3
--- /dev/null
+++ b/document-picker.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Utility for opening documents using dmenu.
+
+DOCS="$HOME/documents"
+
+choice=$(find "$DOCS" -type f 2>/dev/null \
+ | sed "s|^$DOCS/||" \
+ | dmenu -i -l 15 -p "Documents:")
+
+[ -z "$choice" ] && exit 0
+
+xdg-open "$DOCS/$choice" >/dev/null 2>&1 &