From 1187cd8b2179aea5e3271eaf1bce80e7ef1c46cd Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sun, 6 Dec 2020 10:05:30 +0100 Subject: [PATCH] Add rofi taskwarrior launcher --- rofi-task.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 rofi-task.sh diff --git a/rofi-task.sh b/rofi-task.sh new file mode 100755 index 0000000..b8ff5a7 --- /dev/null +++ b/rofi-task.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +# From Kehet +## https://gist.github.com/Kehet/5ba8a530e52ea3a0ae251d756faef680 + +# Rofi colors +black="#000000" +blue="#0094cc" + +# Display pending tasks list and get title from the choosen one +TITLE=$(task export status:pending | jq -r 'sort_by( -.urgency )[] | [ (.id|tostring), .description ] | join(" ")' | + rofi -location 2 -no-auto-select -i -dmenu -p "Task" -color-enabled -color-normal "${black},${blue},${black},${blue},${black}" -color-window "${black},${black}" | + cut --delimiter=" " --field=2) + +[ -z "${TITLE}" ] && echo "Cancelled." && exit 0 + +# Start task with pomodorrior script (task end after 25 minutes) +pomodorrior "${TITLE}" && exit 0 + +exit 255