about summary refs log tree commit diff stats
path: root/hm/soispha/pkgs/scripts/wrappers/neorg
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-10-18 16:02:05 +0200
committerSoispha <soispha@vhack.eu>2023-10-18 16:02:05 +0200
commitf8d7663239d1734c6cab44ca1fdd2af52a5b01b9 (patch)
treed6bf3c8b067771a0b8bb9ff1ad609df4f3633388 /hm/soispha/pkgs/scripts/wrappers/neorg
parentchore(hm/conf/taskwarrior/projects): Update (diff)
downloadnixos-config-f8d7663239d1734c6cab44ca1fdd2af52a5b01b9.zip
fix(hm/pkgs/scrs/neorg): Add a fallback check for the neorg_path
Diffstat (limited to 'hm/soispha/pkgs/scripts/wrappers/neorg')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/neorg5
1 files changed, 4 insertions, 1 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg
index 4d35ea32..142924ef 100755
--- a/hm/soispha/pkgs/scripts/wrappers/neorg
+++ b/hm/soispha/pkgs/scripts/wrappers/neorg
@@ -40,7 +40,10 @@ open_current_task_context() {
     current_context="$(task _get rc.context)";
     if [ "$current_context" ]; then
         context_path="$(task _get rc.context."$current_context".rc.neorg_path)";
-        [ "$context_path" ] || die "All contexts should have a 'neorg_path' set!"
+        if ! [ "$context_path" ]; then
+            context_path="$(grep "context.$current_context.rc.neorg_path" "%HOME_TASKRC" | awk 'BEGIN {FS="="} {print $2}')";
+            [ "$context_path" ] || die "All contexts should have a 'neorg_path' set!"
+        fi
 
         # Perform shell expansion of Tilde
         nvim "$(sed "s|~|$HOME|" "$(ptmp "%DEFAULT_NEORG_PROJECT_DIR/$context_path")")";