From 5956698891b4ba4ad1db9959ff5733d4e8d94ccf Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 3 Apr 2012 15:39:43 -0400 Subject: [PATCH] Wrote a script to show taskwarrior status instead of taskr --- taskx | 19 +++++++++++++++++++ xmobarrc | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 taskx diff --git a/taskx b/taskx new file mode 100755 index 0000000..0db6a7a --- /dev/null +++ b/taskx @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ $(task active | wc -l) -le 1 ]; then + echo No active tasks + exit +fi + +COUNT=$(task active | tail -1 | awk '{print $1}') +ID=$(task active | tail -n +4 | head -1 | awk '{print $1}') + +DESC=$(echo $(task $ID info | grep ^Description | cut -d ' ' -f 2-)) +PROJ=$(echo $(task $ID info | grep ^Project | cut -d ' ' -f 2-)) +TIME=$(echo $(task $ID info | grep 'Total active time' | cut -d ' ' -f 4-)) + +if [ ! -z "$PROJ" ]; then + DESC="[$PROJ] $DESC" +fi + +printf "[1/%d] %s (active for %s)" $COUNT "$DESC" "$TIME" diff --git a/xmobarrc b/xmobarrc index efa7b29..e2f4cb6 100644 --- a/xmobarrc +++ b/xmobarrc @@ -6,12 +6,13 @@ Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*" , commands = [ Run Weather "KNXX" ["-t"," F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000 , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 , Run Memory ["-t","Mem: %"] 10 - , Run Swap [] 10 + , Run Swap ["-t", ""] 10 , Run Battery ["-L", "15", "-H", "50", "--low", "red", "--high", "green", "--normal", "yellow"] 10 , Run Date "%a %b %_d %l:%M" "date" 10 + , Run Com "~/.xmonad/taskx" [] "task" 10 , Run StdinReader ] , sepChar = "%" , alignSep = "}{" - , template = "%StdinReader% }{ %cpu% | %memory% * %swap% | %battery% %date% | %KNXX%" + , template = "%StdinReader% }{ [%cpu% | %memory%, %swap% | Batt: %battery%] %task% %date% | %KNXX%" }