mirror of
https://github.com/correl/xmonadcfg.git
synced 2024-11-23 11:09:57 +00:00
Wrote a script to show taskwarrior status instead of taskr
This commit is contained in:
parent
5bf095d466
commit
5956698891
2 changed files with 22 additions and 2 deletions
19
taskx
Executable file
19
taskx
Executable 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"
|
5
xmobarrc
5
xmobarrc
|
@ -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
|
||||
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 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 Date "%a %b %_d %l:%M" "date" 10
|
||||
, Run Com "~/.xmonad/taskx" [] "task" 10
|
||||
, Run StdinReader
|
||||
]
|
||||
, sepChar = "%"
|
||||
, 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%"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue