From f8d7663239d1734c6cab44ca1fdd2af52a5b01b9 Mon Sep 17 00:00:00 2001 From: Soispha Date: Wed, 18 Oct 2023 16:02:05 +0200 Subject: fix(hm/pkgs/scrs/neorg): Add a fallback check for the neorg_path --- hm/soispha/pkgs/scripts.nix | 1 + hm/soispha/pkgs/scripts/wrappers/neorg | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'hm/soispha/pkgs') diff --git a/hm/soispha/pkgs/scripts.nix b/hm/soispha/pkgs/scripts.nix index e36ae62e..4124cf60 100644 --- a/hm/soispha/pkgs/scripts.nix +++ b/hm/soispha/pkgs/scripts.nix @@ -52,6 +52,7 @@ replacementStrings = { DEFAULT_NEORG_PROJECT_DIR = config.programs.nixvim.plugins.neorg.modules."core.dirman".config.workspaces.projects; + HOME_TASKRC = "${config.xdg.configHome}/task/home-manager-taskrc"; }; }; update-sys-scr = write_script { 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")")"; -- cgit 1.4.1