Update mowedline look for transparent background

This commit is contained in:
Tom Willemse 2015-07-31 16:36:18 +02:00
parent 4236a07922
commit f4f7f4fa3b
2 changed files with 47 additions and 24 deletions

View file

@ -1,13 +1,21 @@
(use srfi-1 matchable) (use srfi-1 matchable)
(define (not-text? text)
(or (null? text) (and (not (pair? text)) (string-null? text))))
(define (string-maybe-pad-left text) (define (string-maybe-pad-left text)
(if (string-null? text) (if (not-text? text)
text text
(string-append " " text))) (L " " text)))
(define (text-maybe-pad-both text)
(if (not-text? text)
text
(L " " text " ")))
(define (add-fa-icon icon) (define (add-fa-icon icon)
(lambda (text) (lambda (text)
(if (string-null? text) (if (not-text? text)
text text
(list (list 'font "FontAwesome-10" (list (list 'font "FontAwesome-10"
(string-append " " icon " ")) (string-append " " icon " "))
@ -21,11 +29,11 @@
(define tag-display (define tag-display
(match-lambda (match-lambda
((#\# n) (L (L 'color "#ececec" 'font "FontAwesome-12" "") " ")) ((#\# n) (L (L 'color "#ececec" 'font "FontAwesome-10" "") " "))
((#\- n) (L (L 'color "#bfbfbf" 'font "FontAwesome-12" "") " ")) ((#\- n) (L (L 'color "#bfbfbf" 'font "FontAwesome-10" "") " "))
((#\. n) (L (L 'color "#969696" 'font "FontAwesome-12" "") " ")) ((#\. n) (L (L 'color "#969696" 'font "FontAwesome-10" "") " "))
((#\: n) (L (L 'color "#969696" 'font "FontAwesome-12" "") " ")) ((#\: n) (L (L 'color "#969696" 'font "FontAwesome-10" "") " "))
((#\! n) (L (L 'color "#a85454" 'font "FontAwesome-12" "") " ")))) ((#\! n) (L (L 'color "#a85454" 'font "FontAwesome-10" "") " "))))
(define (tag-list-display tag-list) (define (tag-list-display tag-list)
(map tag-display tag-list)) (map tag-display tag-list))
@ -36,25 +44,34 @@
(text-widget-font "Fantasque Sans Mono-13:bold") (text-widget-font "Fantasque Sans Mono-13:bold")
(text-widget-color "#ededed") (text-widget-color "#ededed")
(text-widget-format string-maybe-pad-left) (text-widget-format text-maybe-pad-both)
(widget-background-color "#000000")
(window (window
'position 'top 'position 'bottom
'width 1890 'width 1890
'margin-top 15 'margin-bottom 15
'margin-left 15 'margin-left 15
'margin-right 15 'margin-right 15
'background 'inherit
(widget:text 'name "taglist"
'format (compose string-maybe-pad-left tag-list-formatter)
'background-color "#3d3d3d")
(widget:spacer 'flex 1)
(widget:text 'name "mpd"
'format (add-fa-icon "")
'background-color "#3d3d3d")
(widget:spacer 'width 5) (widget:spacer 'width 5)
(widget:text 'name "taglist" 'format tag-list-formatter) (widget:text 'name "irclist"
(widget:spacer 'width 10) 'background-color "#3d3d3d")
(widget:text 'name "mpd" 'format (add-fa-icon "") 'flex 1) (widget:spacer 'width 5)
(widget:flags (widget:text 'name "email"
'name "keychain" 'format (compose text-maybe-pad-both (add-fa-icon ""))
'background-color "#3d3d3d")
(widget:spacer 'width 5)
(widget:flags 'name "keychain"
'font "FontAwesome-10" 'font "FontAwesome-10"
'flags '(("Unlocked" . "") 'flags '(("Unlocked" . "")
("Locked" . "")) ("Locked" . ""))
'format text-maybe-pad-left) 'background-color "#3d3d3d")
(widget:text 'name "email" 'format (add-fa-icon "")) (widget:spacer 'width 5)
(widget:clock) (widget:clock 'background-color "#3d3d3d"))
(widget:spacer 'width 5))

View file

@ -18,6 +18,12 @@ kupfer --no-splash &
mowedline & mowedline &
mpc-status-mowedline & mpc-status-mowedline &
while true; do
mowedline-client update "taglist" "$(herbstclient tag_status)" \
2>/dev/null
herbstclient --wait tag_changed >/dev/null
done &
export $(/usr/bin/gnome-keyring-daemon --start --components=secrets,gpg) export $(/usr/bin/gnome-keyring-daemon --start --components=secrets,gpg)
# exec ~/.local/share/quicklisp/local-projects/stumpwm/stumpwm # exec ~/.local/share/quicklisp/local-projects/stumpwm/stumpwm