123456789101112131415161718192021222324 |
- (use-modules (zenity))
- (let* ((length (or (zenity-list "What would you like to time?"
- '("Time" "Operation")
- '(("10s" "Count to ten..")
- ("5m" "Soft boiled egg")
- ("8m" "Hard boiled egg")
- ("45m" "Baked potato"))
- #:height 250)
- (exit)))
- (seconds (case (string->symbol (car length))
- ((10s) 10)
- ((5m) (* 5 60))
- ((8m) (* 8 60))
- ((45m) (* 45 60))
- (else (error "Could not understand the time command"))))
- (progress (zenity-progress "Timing.." #:auto-close #t)))
- (let loop ((remaining seconds))
- (progress (round (* 100 (/ (- seconds remaining) seconds))))
- (sleep 1)
- (unless (<= remaining 0)
- (loop (- remaining 1))))
- (zenity-info "Done!"))
|