diff options
-rw-r--r-- | hm/soispha/pkgs/scripts.nix | 1 | ||||
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/neorg | 5 |
2 files changed, 5 insertions, 1 deletions
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")")"; |