Add book counter

8479448ac94cd2665722e8b6ad9a916b07ff1468
Alexis Sellier committed ago 1 parent c7703394
.xmobarrc +2 -1
13 13
                  , Run Date       "%b %d %Y %H:%M" "date" 10
14 14
                  , Run DiskU      [("/", "<used>/<size>"), ("/home", "<used>/<size>")] [] 20
15 15
                  , Run Com        "xmobar-dropbox-status" [] "dropbox" 10
16 16
                  , Run Com        "xmobar-brightness" [] "brightness" 10
17 17
                  , Run Com        "seedbox-status" [] "seedbox" 10
18 +
                  , Run Com        "book-counter" [] "book" 1000
18 19
                  , Run CoreTemp   [ "--template", "<core0>° <core1>°" ] 50
19 20
                  , Run Wireless   "wlp58s0" [ "--template", "☎ <essid>/<quality>"] 10
20 21
                  , Run Battery    [ "--template", "⌁ <left>%" ] 100
21 22
                  , Run StdinReader
22 23
                  ]
23 24
     , sepChar = "%"
24 25
     , alignSep = "}{"
25 -
     , template = "%StdinReader%  }{┊ %brightness% ┊ %battery% ┊ %wlp58s0wi% ┊ %seedbox% ┊ %dropbox% ┊ %multicpu% · %memory% · %disku% · %dynnetwork% ┊ <fc=#aaaaaa>%date%</fc> "
26 +
     , template = "%StdinReader%  }{ %book% ┊ %brightness% ┊ %battery% ┊ %wlp58s0wi% ┊ %seedbox% ┊ %dropbox% ┊ %multicpu% · %memory% · %disku% · %dynnetwork% ┊ <fc=#aaaaaa>%date%</fc> "
26 27
}
bin/book-counter added +8 -0
1 +
#!/bin/env ruby
2 +
3 +
require 'date'
4 +
5 +
from = Date.new(2015, 10, 1)
6 +
to   = Date.today
7 +
8 +
puts "Day #{(to - from).to_i}"