diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-24 13:54:03 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-24 13:54:03 +0900 |
| commit | 28e8bdf7f8286bd431b7f3b709e79f3827b31469 (patch) | |
| tree | 85b44eff6da4d8443198fb6e04dfb6ee55244588 /debian/.local/bin/opentasktui | |
| parent | 8470ff001befcfd0f626dea69a9e76d43aee0511 (diff) | |
updates
Diffstat (limited to 'debian/.local/bin/opentasktui')
| -rwxr-xr-x | debian/.local/bin/opentasktui | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/.local/bin/opentasktui b/debian/.local/bin/opentasktui new file mode 100755 index 0000000..1db6bef --- /dev/null +++ b/debian/.local/bin/opentasktui @@ -0,0 +1,27 @@ +#!/bin/sh + +# Capture the current session name +current_session=$(tmux display-message -p '#S') + +# Parse the task description from the argument +task_description="$1" + +# Create a new tmux session named 'new-task-session' and run 'tui -r current' +tmux new-session -d -s new-task-session "taskwarrior-tui -r current" + +# Sleep for a bit to allow tui to load +sleep 0.1 + +# Send the keystrokes needed to filter tasks by description to the target pane +tmux send-keys -t new-task-session:1.1 "/description:$task_description" C-m + +# Attach to the new session +tmux switch-client -t new-task-session + +# Wait for the session to be closed, either by the user or some other way +while tmux has-session -t new-task-session 2>/dev/null; do + sleep 0.1 +done + +# Switch back to the original session +tmux switch-client -t "$current_session" |
