diff options
author | Soispha <soispha@vhack.eu> | 2023-12-28 19:38:03 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-12-28 19:38:03 +0100 |
commit | bd7226bc8a577b4e4f084c5195663052041535fd (patch) | |
tree | df5d1ed5155792bb03ba86819ff9a3b652bd5046 | |
parent | fix(hm/pkgs/src/neorg): Move to script as completion generation function (diff) | |
download | nixos-config-bd7226bc8a577b4e4f084c5195663052041535fd.tar.gz nixos-config-bd7226bc8a577b4e4f084c5195663052041535fd.zip |
fix(hm/pkgs/scr/neorg): Convert context to project before use
Diffstat (limited to '')
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/neorg/neorg | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg/neorg index fdbb2ec6..3193ab0a 100755 --- a/hm/soispha/pkgs/scripts/wrappers/neorg/neorg +++ b/hm/soispha/pkgs/scripts/wrappers/neorg/neorg @@ -81,6 +81,16 @@ UTILS_get_neorg_project_dir() { neorg_project_dir="$(sed "s|~|$HOME|" "$(ptmp "%DEFAULT_NEORG_PROJECT_DIR")")"; printf "%s\n" "$neorg_project_dir" } +UTILS_project_to_context_name() { + project="$1"; + context="$(sed 's|.|_|' "$(ptmp "$project")")"; + printf "%s\n" "$context"; +} +UTILS_context_to_project_name() { + context="$1"; + project="$(sed 's|_|.|' "$(ptmp "$context")")"; + printf "%s\n" "$project"; +} # }}} # Workspace {{{ @@ -137,13 +147,13 @@ CONTEXT_open_current_task_context_at_task_id() { PROJECT_open_current_context_in_browser() { current_context="$(UTILS_get_current_context)"; [ "$current_context" ] || WORKSPACE_open_neorg_workspace_prompt; - PROJECT_open_context_in_browser "$current_context"; + PROJECT_open_context_in_browser "$(UTILS_context_to_project_name "$current_context")"; } PROJECT_open_context_in_browser() { context="$1"; [ "$context" ] || die "BUG: No context supplied to PROJECT_open_context_in_browser" - old_context="$(task _get rc.context)"; + old_context="$(UTILS_get_current_context)"; # We have ensured that only one task may be active old_started_task="$(task +ACTIVE _ids)"; @@ -156,7 +166,7 @@ PROJECT_open_context_in_browser() { task_id="$(echo "$description" | awk -F: '{print $1}' )"; notify-send "(Neorg)" "Starting task $context -> $desc"; task start "$task_id" - task context "$context" + task context "$(UTILS_project_to_context_name "$context")" fi break done < "$tracking" |