ryuslash's Config

0.2.9

Here is ryuslash's dot-mowedline, for mowedline 0.2.9-dev. Its basic structure is as follows:

Where each number is the name of a tag. The meanings of the symbols is as following:

The split-tag-list function splits the string up at each tab character and splits each resulting string into a list of characters. The tag-list-display function just maps the tag-display function over the list. The tag-display function uses matchable to determine the Font Awesome icon to use and color to show the icon in.

I prefer my mowedline to be completely transparent, so I set the window's background to transparent. I run the compton compositor to get real transparency in both X windows and mowedline. My IRC client updates the irclist widget, which uses identity as formatter, because I don't want to change anything about its formatting and my default formatter is text-maybe-pad-both, it just happens that my IRC client already pads its output with a single space on both sides. My taglist, email and keychain widgets are all updated by external scripts and the active-window-title and clock widgets are filled by mowedline automatically.

Source:

(use srfi-1 matchable)

(define (not-text? text)
  (or (null? text) (and (not (pair? text)) (string-null? text))))

(define (text-maybe-pad-both text)
  (if (not-text? text)
      text
      (L " " text " ")))

(define (add-fa-icon icon)
  (lambda (text)
    (if (not-text? text)
        text
        (list (list 'font "FontAwesome-10"
                    (string-append " " icon " "))
              text))))

(define (split-tag-list str)
  (map string->list (string-split str "\t")))

(define tag-display
  (match-lambda
    ((#\# n) (L (L 'color "#ececec" 'font "FontAwesome-10" "") " "))
    ((#\- n) (L (L 'color "#bfbfbf" 'font "FontAwesome-10" "") " "))
    ((#\. n) (L (L 'color "#969696" 'font "FontAwesome-10" "") " "))
    ((#\: n) (L (L 'color "#969696" 'font "FontAwesome-10" "") " "))
    ((#\! n) (L (L 'color "#a85454" 'font "FontAwesome-10" "") " "))))

(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 text-maybe-pad-both)

(window
 'position 'bottom
 'width 1890
 'margin-bottom 15
 'margin-left 15
 'margin-right 15
 'background 'transparent
 (widget:text 'name "taglist"
              'format (compose string-maybe-pad-left tag-list-formatter))
 (widget:spacer 'width 5)
 (widget:active-window-title)
 (widget:spacer 'flex 1)
 (widget:text 'name "irclist" 'format identity)
 (widget:spacer 'width 5)
 (widget:text 'name "email"
              'format (compose text-maybe-pad-both (add-fa-icon "")))
 (widget:spacer 'width 5)
 (widget:flags 'name "keychain"
               'font "FontAwesome-10"
               'flags '(("Unlocked" . "")
                        ("Locked" . "")))
 (widget:spacer 'width 5)
 (widget:clock))