37 lines
689 B
Plaintext
37 lines
689 B
Plaintext
(def black "[30m")
|
||
(def red "[31m")
|
||
(def green "[32m")
|
||
(def yellow "[33m")
|
||
(def blue "[34m")
|
||
(def purple "[35m")
|
||
(def cyan "[36m")
|
||
(def white "[37m")
|
||
|
||
(def bold "[1m")
|
||
(def reset "[0m")
|
||
|
||
(def nl (ch 10))
|
||
|
||
(def conf (cat (env "HOME") "/.pebblisp.pbl"))
|
||
|
||
(def reload (fn () (loadfile conf)))
|
||
|
||
(def hour (fn (ti) (
|
||
(def h (% ti.hour 12))
|
||
(if (= 0 h) 12 h)
|
||
)))
|
||
|
||
(def pwd (fn () (env "PWD")))
|
||
|
||
(def zero (fn (num) (cat (if (< num 10) "0" "") num)))
|
||
|
||
(def clock (fn (ti) (cat (hour ti) ":" (zero ti.minute) ":" (zero ti.sec))))
|
||
|
||
(def prompt (fn (a) (
|
||
(def ti (time))
|
||
|
||
(cat nl
|
||
bold red "[sage] " blue (clock) " " reset cyan (pwd) nl
|
||
bold green "pebblisp ~> " reset)
|
||
)))
|