~lucasemmoreira/hitter

bb695f9e412425ab173bc12c303041cf657878a9 — Lucas Moreira 2 years ago d544b56
add: variable for sleep time
1 files changed, 4 insertions(+), 2 deletions(-)

M src/tui.janet
M src/tui.janet => src/tui.janet +4 -2
@@ 1,6 1,8 @@
(import janet-ncurses :as nc)
(import ./hit :as hit)

(def sleeping 15)

(defn build-win [win names status]
  (nc/wclear win)
  (for i 0 (length names)


@@ 18,7 20,7 @@
			       (while true
				 (yield (map (fn [status] (string status))
					     (hit/status-urls urls)))))))
  (nc/mvwprintw (nc/stdscr) 1 1 "Press 'q' to leave. And any other key to update the table")
  (nc/mvwprintw (nc/stdscr) 1 1 (string "It will update every " sleeping " seconds. To leave, `C-c`."))
  (nc/refresh)
  (var status (map (fn [url] "checking...") urls))
  (var menu-win (nc/newwin 10 40 4 4))


@@ 28,6 30,6 @@
  (while true
    (var status (resume url-status))
    (build-win menu-win names status)
    (os/sleep 15)) # 113 is the letter q
    (os/sleep sleeping)) # 113 is the letter q

  (nc/endwin))