blob: 6056f61486d84c08cb47993f87b955a4a57d803f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
(use srfi-1 matchable)
(define (string-maybe-pad-left text)
(if (string-null? text)
text
(string-append " " text)))
(define (add-fa-icon icon)
(lambda (text)
(if (string-null? text)
text
(list (list 'font "FontAwesome-10"
(string-append " " icon " "))
text))))
(define (merge . lists)
(flatten (apply zip lists)))
(define (split-tag-list str)
(map string->list (string-split str "\t")))
(define tag-display
(match-lambda
((#\# n) (L (L 'color "#ececec" 'font "FontAwesome-12" "") " "))
((#\- n) (L (L 'color "#bfbfbf" 'font "FontAwesome-12" "") " "))
((#\. n) (L (L 'color "#969696" 'font "FontAwesome-12" "") " "))
((#\: n) (L (L 'color "#969696" 'font "FontAwesome-12" "") " "))
((#\! n) (L (L 'color "#a85454" 'font "FontAwesome-12" "") " "))))
(define (tag-list-display tag-list)
(map tag-display tag-list))
(define (tag-list-formatter text)
(let ((tag-list (split-tag-list text)))
(tag-list-display tag-list)))
(text-widget-font "Fantasque Sans Mono-13:bold")
(text-widget-color "#ededed")
(text-widget-format string-maybe-pad-left)
(widget-background-color "#000000")
(window
'position 'top
'width 1890
'margin-top 15
'margin-left 15
'margin-right 15
(widget:spacer 'width 5)
(widget:text 'name "taglist" 'format tag-list-formatter)
(widget:spacer 'width 10)
(widget:text 'name "mpd" 'format (add-fa-icon "") 'flex 1)
(widget:flags
'name "keychain"
'font "FontAwesome-10"
'flags '(("Unlocked" . "")
("Locked" . ""))
'format text-maybe-pad-left)
(widget:text 'name "email" 'format (add-fa-icon ""))
(widget:clock)
(widget:spacer 'width 5))
|