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%" }