summaryrefslogtreecommitdiffstats
path: root/mowedline
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-07-29 13:37:37 +0200
committerGravatar Tom Willemse2015-07-29 13:37:37 +0200
commit4236a079228943c3a4f19fbfd979b711a5ff6a9f (patch)
tree79a960fd11baf1e6738a4e2b9d31602f558e76d7 /mowedline
parent8a0a2886c8824112293c6bcee3e42c7e9db0d228 (diff)
downloaddotfiles-4236a079228943c3a4f19fbfd979b711a5ff6a9f.tar.gz
dotfiles-4236a079228943c3a4f19fbfd979b711a5ff6a9f.zip
Add taglist to mowedline
Diffstat (limited to 'mowedline')
-rw-r--r--mowedline/.config/mowedline/init.scm25
1 files changed, 24 insertions, 1 deletions
diff --git a/mowedline/.config/mowedline/init.scm b/mowedline/.config/mowedline/init.scm
index 03c4605..6056f61 100644
--- a/mowedline/.config/mowedline/init.scm
+++ b/mowedline/.config/mowedline/init.scm
@@ -1,3 +1,5 @@
+(use srfi-1 matchable)
+
(define (string-maybe-pad-left text)
(if (string-null? text)
text
@@ -11,6 +13,27 @@
(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)
@@ -23,7 +46,7 @@
'margin-left 15
'margin-right 15
(widget:spacer 'width 5)
- (widget:text 'name "title" 'text "drd")
+ (widget:text 'name "taglist" 'format tag-list-formatter)
(widget:spacer 'width 10)
(widget:text 'name "mpd" 'format (add-fa-icon "") 'flex 1)
(widget:flags