diff options
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/neorg | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg index 1173e474..f11772ae 100755 --- a/hm/soispha/pkgs/scripts/wrappers/neorg +++ b/hm/soispha/pkgs/scripts/wrappers/neorg @@ -139,7 +139,35 @@ 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)"; + # We have ensured that only one task may be active + old_started_task="$(task +ACTIVE _ids)"; + + tracking="$(mktmp)"; + task "project:$context" _ids | xargs task _zshids > "$tracking"; + + while read -r description; do + desc="$(echo "$description" | awk -F: '{print $2}' )"; + if [ "$desc" = "tracking" ]; then + task_id="$(echo "$description" | awk -F: '{print $1}' )"; + notify-send "(Neorg)" "Starting task $context -> $desc"; + task start "$task_id" + task context "$context" + fi + break + done < "$tracking" + + firefox -P "$context" + + task stop "$task_id" + [ "$old_started_task" ] && task start "$old_started_task" + + if [ "$old_context" ]; then + task context "$old_context" + else + task context none + fi } # }}} # Dmenu {{{ |