From 60f5788fceceaf2a38f0e1bbc125d3f628677757 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 2 May 2023 15:58:56 +0200 Subject: [PATCH] Task: Use delimiter to search tasks --- rofi-task.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rofi-task.sh b/rofi-task.sh index aac1ca2..1b6be1f 100755 --- a/rofi-task.sh +++ b/rofi-task.sh @@ -82,16 +82,15 @@ display_current_task() { # {{{ ## Display active tasks list and get title from the choosen one TITLE=$(rofi -theme solarized_alternate -location 2 -l 5 -no-auto-select -i -dmenu -p "RUNNING task(s)" < "${TASKW_CURRENT_LIST}" | - cut --delimiter=" " --field=2 | - sed "s/[0-9]//g") - ID=$(task "${TITLE}" simpleid | grep --after-context=2 -- ID | tail --lines=1 || return 0) + cut --delimiter=" " --field=2) + ID=$(task "/${TITLE}/" simpleid | grep --after-context=2 -- ID | tail --lines=1 || return 0) ## Remove temp file rm --force -- "${TASKW_CURRENT_LIST}" ## If no task was selected (empty var) then exit if [ -z "${TITLE}" ]; then - echo "Cancelled." + echo "Cancelled no selected task." debug_message "display_current_task − \ TITLE var is ${RED}empty${COLOR_DEBUG}." exit 0 @@ -102,7 +101,7 @@ TITLE var: ${RED}${TITLE}${RESET}." ## If no ID was found (empty var) then exit if [ -z "${ID}" ]; then - echo "Cancelled." + echo "Cancelled no ID found for this task." debug_message "display_current_task − \ ID var is ${RED}empty${COLOR_DEBUG}." exit 0