Do not set state to 'warning' if tasks are complete

* Also, show complete/total
This commit is contained in:
Brian Buller 2021-04-29 11:36:05 -05:00
parent 2ba309fe36
commit c9813b1aaf

View File

@ -28,12 +28,16 @@ func (a *AppState) opI3Status(args []string) int {
if state != "Warning" { if state != "Warning" {
warning := a.config.Get("i3status_warning") warning := a.config.Get("i3status_warning")
if warning != "" { if warning != "" {
if len(*a.getFilteredList(warning)) > 0 { t := a.getFilteredList(warning)
for _, v := range *t {
if !v.HasCompletedDate() {
state = "Warning" state = "Warning"
break
} }
} }
} }
fmt.Printf("{\"icon\":\"tasks\",\"state\":\"%s\", \"text\": \"%s: %d/%d\"}", state, filterString, incomplete, total) }
fmt.Printf("{\"icon\":\"tasks\",\"state\":\"%s\", \"text\": \"%s: %d/%d\"}", state, filterString, (total - incomplete), total)
return 0 return 0
} }