commit 440c3a1d1dc897d1051bdc270728acd438d675ae parent 3ff6dfb649d7d294b8d6f9d4256503cc0e3126c3 Author: prenev <an2qzavok@gmail.com> Date: Thu, 22 Apr 2021 22:11:29 +0300 fix style, LISPers use dash-case for their code Diffstat:
M | dwmstatus.scm | | | 26 | +++++++++++++------------- |
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/dwmstatus.scm b/dwmstatus.scm @@ -6,30 +6,30 @@ (define Time "") (define Message "") -(define XSetRootName +(define xsetrootname (lambda () (system* "xsetroot" "-name" (string-append Message Time)))) -(define TimeThread +(define time-thread (call-with-new-thread (lambda () (while #t (set! Time (strftime "%F %T" (localtime (current-time)))) - (XSetRootName) + (xsetrootname) (sleep 1))))) -(define MessageThread +(define message-thread (call-with-new-thread (lambda () - (define MessageFlush) - (define SockName "/tmp/dwmstatus.sock") + (define message-flush) + (define sock-name "/tmp/dwmstatus.sock") (define sock (socket PF_UNIX SOCK_STREAM 0)) (define sock2 0) (define rlen 0) (define buf (make-bytevector 2048 0)) (define buf2 0) - (if (access? SockName F_OK) (delete-file SockName)) - (bind sock AF_UNIX SockName) + (if (access? sock-name F_OK) (delete-file sock-name)) + (bind sock AF_UNIX sock-name) (listen sock 16) (while #t (set! sock2 (car (accept sock))) @@ -37,14 +37,14 @@ (set! buf2 (make-bytevector rlen 0)) (bytevector-copy! buf 0 buf2 0 rlen) (set! Message (string-append (utf8->string buf2) " ")) - (XSetRootName) + (xsetrootname) (close-port sock2) - (if (thread? MessageFlush) (cancel-thread MessageFlush)) - (set! MessageFlush (call-with-new-thread + (if (thread? message-flush) (cancel-thread message-mlush)) + (set! message-flush (call-with-new-thread (lambda() (sleep 3) (set! Message ""))))) (close sock)))) -(join-thread TimeThread) -(join-thread MessageThread) +(join-thread time-thread) +(join-thread message-thread)