diff options
| author | Paul Buetow <paul@buetow.org> | 2025-04-16 11:32:48 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-04-16 11:32:48 +0300 |
| commit | 7a287e82a0b9ffa473c0601e7c864de3dc454316 (patch) | |
| tree | 2b17704e602589af9254e60a05a4c85496443107 | |
| parent | 7694fd4c68e0f487dac11217f480608aef4013ed (diff) | |
initial
| -rw-r--r-- | dotfiles/zsh/zshrc_d/task.source.zsh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dotfiles/zsh/zshrc_d/task.source.zsh b/dotfiles/zsh/zshrc_d/task.source.zsh index 659df41..1eedc9d 100644 --- a/dotfiles/zsh/zshrc_d/task.source.zsh +++ b/dotfiles/zsh/zshrc_d/task.source.zsh @@ -51,6 +51,23 @@ if [[ -f ~/.taskrc && -f ~/.task.enable ]]; then } alias tedit=task::edit + task::url::open () { + task::select "$1" + local -r desc=$(task +track status:pending export | jq -r '.[].description') + local -r url=$(extractUrlFromString "$desc") + open -a "Google Chrome" "$url" + } + + extractUrlFromString () { + local -r str="$1" + local -r regex="(https?://[a-zA-Z0-9.-]+(/[a-zA-Z0-9._%+-/?&=]*))" + if [[ $str =~ $regex ]]; then + echo "${BASH_REMATCH[1]}" + else + echo "No URL found" + fi + } + task::del () { task::select "$1" task $TASK_ID delete |
