about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/neorg/neorg16
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"