From d475107efb16535f03e0409bce3809233fbc1478 Mon Sep 17 00:00:00 2001 From: Soispha Date: Thu, 7 Mar 2024 15:43:01 +0100 Subject: feat(pkgs/scripts/neorg/review): Only review opened projects --- .../pkgs/scripts/source/specific/neorg/sh/functions/dmenu.sh | 2 ++ .../pkgs/scripts/source/specific/neorg/sh/functions/review.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/nixpkgs/pkgs/scripts/source/specific') diff --git a/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/dmenu.sh b/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/dmenu.sh index 73e9460a..5a138982 100755 --- a/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/dmenu.sh +++ b/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/dmenu.sh @@ -4,6 +4,8 @@ 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" diff --git a/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/review.sh b/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/review.sh index ab9ec6b1..a0a9ab8d 100755 --- a/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/review.sh +++ b/sys/nixpkgs/pkgs/scripts/source/specific/neorg/sh/functions/review.sh @@ -2,8 +2,11 @@ review0start() { for project in $(list0list_all_contexts_newline); do - msg "Starting '$project'" - notify-send "Neorg" "Starting '$project'" - firefox -P "$project" + if [ -f "%NEORG_REVIEW_PATH/$project.lock" ]; then + msg "Reviewing '$project'" + notify-send "Neorg" "Reviewing '$project'" + firefox -P "$project" + rm "%NEORG_REVIEW_PATH/$project.lock" + fi done } -- cgit 1.4.1