mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-14 07:00:32 -05:00
weather: Actually show the weather.
* guix/scripts/weather.scm (report-server-coverage): Show a weather icon.
This commit is contained in:
parent
8084e3bdb3
commit
818220f1cc
1 changed files with 9 additions and 1 deletions
|
@ -205,7 +205,6 @@ (define MiB (* (expt 2 20) 1.))
|
|||
#:make-progress-reporter
|
||||
(lambda* (total #:key url #:allow-other-keys)
|
||||
(progress-reporter/bar total)))))
|
||||
(format #t (highlight "~a~%") server)
|
||||
(let ((obtained (length narinfos))
|
||||
(requested (length items))
|
||||
(missing (lset-difference string=?
|
||||
|
@ -224,6 +223,15 @@ (define MiB (* (expt 2 20) 1.))
|
|||
(coloring-procedure (color BOLD RED)))
|
||||
(else
|
||||
highlight))))
|
||||
(format #t (highlight "~a ~a~%") server
|
||||
;; This requires a Unicode-capable encoding, which we
|
||||
;; restrict to UTF-8 for simplicity.
|
||||
(if (string=? (port-encoding (current-output-port)) "UTF-8")
|
||||
(cond ((> ratio 0.80) "☀")
|
||||
((< ratio 0.50) "⛈")
|
||||
(else "⛅"))
|
||||
""))
|
||||
|
||||
(format #t
|
||||
(colorize (G_ " ~,1f% substitutes available (~h out of ~h)~%"))
|
||||
(* 100. ratio)
|
||||
|
|
Loading…
Reference in a new issue