Wrote a script to show taskwarrior status instead of taskr

This commit is contained in:
Correl Roush 2012-04-03 15:39:43 -04:00
parent 5bf095d466
commit 5956698891
2 changed files with 22 additions and 2 deletions

19
taskx Executable file
View file

@ -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"

View file

@ -6,12 +6,13 @@ Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, commands = [ Run Weather "KNXX" ["-t"," <tempF>F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000 , commands = [ Run Weather "KNXX" ["-t"," <tempF>F","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10 , Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10 , Run Swap ["-t", "<usedratio>"] 10
, Run Battery ["-L", "15", "-H", "50", "--low", "red", "--high", "green", "--normal", "yellow"] 10 , Run Battery ["-L", "15", "-H", "50", "--low", "red", "--high", "green", "--normal", "yellow"] 10
, Run Date "%a %b %_d %l:%M" "date" 10 , Run Date "%a %b %_d %l:%M" "date" 10
, Run Com "~/.xmonad/taskx" [] "task" 10
, Run StdinReader , Run StdinReader
] ]
, sepChar = "%" , sepChar = "%"
, alignSep = "}{" , alignSep = "}{"
, template = "%StdinReader% }{ %cpu% | %memory% * %swap% | %battery% <fc=#ee9a00>%date%</fc> | %KNXX%" , template = "%StdinReader% }{ [%cpu% | %memory%, %swap% | Batt: %battery%] <fc=yellow>%task%</fc> <fc=#ee9a00>%date%</fc> | %KNXX%"
} }