aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Thestrup <mikkel@mithe.dk>2026-01-28 22:38:27 +0100
committerMikkel Thestrup <mikkel@mithe.dk>2026-01-28 22:38:27 +0100
commit83107c60c0a1135e4548d588eef7d94b2adaa1af (patch)
tree5f74980b351ab0b358c08c37989e0d710eb46e51
parent35536c401016c0ac69c164a65d2c31b74992a808 (diff)
downloadscripts-83107c60c0a1135e4548d588eef7d94b2adaa1af.tar.gz
scripts-83107c60c0a1135e4548d588eef7d94b2adaa1af.zip
Script for opening documents using dmenu
-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 &