about summary refs log tree commit diff stats
path: root/pkgs/by-name/ne/neorg/functions/dmenu.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ne/neorg/functions/dmenu.sh')
-rwxr-xr-xpkgs/by-name/ne/neorg/functions/dmenu.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/by-name/ne/neorg/functions/dmenu.sh b/pkgs/by-name/ne/neorg/functions/dmenu.sh
new file mode 100755
index 00000000..5a138982
--- /dev/null
+++ b/pkgs/by-name/ne/neorg/functions/dmenu.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env dash
+
+dmenu0open_context_in_browser() {
+    project="$(echo "%ALL_PROJECTS_PIPE" | rofi -sep "|" -dmenu)"
+
+    if [ "$project" ]; then
+        [ -d "%NEORG_REVIEW_PATH" ] || mkdir --parents "%NEORG_REVIEW_PATH"
+        [ -f "%NEORG_REVIEW_PATH/$project.lock" ] || touch "%NEORG_REVIEW_PATH/$project.lock"
+        project0open_project_in_browser "$project"
+    else
+        notify-send "(neorg/dmenu) No project selected"
+        exit 1
+    fi
+}