Add todo-widget
e49134ce80eb9d181f71b9f42413465923aa5f7b
1 parent
72026928
.xmobarrc
+2 -1
| 12 | 12 | , Run MultiCpu [ "--template", "<total0>% <total1>% <total2>% <total3>%", "-w", "3" ] 50 |
|
| 13 | 13 | , Run Memory [ "--template", "<used>/<available> MB" ] 50 |
|
| 14 | 14 | , Run Date "%b %d %Y %H:%M" "date" 10 |
|
| 15 | 15 | , Run DiskU [("/", "<used>/<size>"), ("/home", "<used>/<size>")] [] 20 |
|
| 16 | 16 | , Run Com "xmobar-dropbox-status" [] "dropbox" 10 |
|
| 17 | + | , Run Com "todo-widget" [] "todo" 10 |
|
| 17 | 18 | , Run Com "xmobar-brightness" [] "brightness" 10 |
|
| 18 | 19 | , Run Com "seedbox-status" [] "seedbox" 10 |
|
| 19 | 20 | , Run CoreTemp [ "--template", "<core0>° <core1>°" ] 50 |
|
| 20 | 21 | , Run Wireless "wlp58s0" [ "--template", "☎ <essid>/<quality>"] 10 |
|
| 21 | 22 | , Run Battery [ "--template", "⌁ <left>%" ] 100 |
|
| 22 | 23 | , Run StdinReader |
|
| 23 | 24 | ] |
|
| 24 | 25 | , sepChar = "%" |
|
| 25 | 26 | , alignSep = "}{" |
|
| 26 | - | , template = "%StdinReader% }{ %brightness% %battery% %wlp58s0wi% %seedbox% %dropbox% %multicpu% · %memory% · %disku% · %dynnetwork% <fc=#aaaaaa>%date%</fc> " |
|
| 27 | + | , template = "%StdinReader% }{ %todo% %brightness% %battery% %wlp58s0wi% %seedbox% %dropbox% %multicpu% · %memory% · %disku% · %dynnetwork% <fc=#aaaaaa>%date%</fc> " |
|
| 27 | 28 | } |
bin/todo-widget
added
+13 -0
| 1 | + | #!/usr/bin/env ruby |
|
| 2 | + | ||
| 3 | + | n = Dir["#{ENV['HOME']}/todo/*"].map do |todo| |
|
| 4 | + | File.read(todo).lines.map do |l| |
|
| 5 | + | /\[ \]/.match?(l) |
|
| 6 | + | end.count(true) |
|
| 7 | + | end.sum |
|
| 8 | + | ||
| 9 | + | if n.zero? |
|
| 10 | + | print "∅" |
|
| 11 | + | else |
|
| 12 | + | print "<fc=#d00>≡ #{n}</fc>" |
|
| 13 | + | end |