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)
(define (not-text? text)
(or (null? text) (and (not (pair? text)) (string-null? text))))
(define (string-maybe-pad-left text)
(if (string-null? text)
(if (not-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)
(lambda (text)
(if (string-null? text)
(if (not-text? text)
text
(list (list 'font "FontAwesome-10"
(string-append " " icon " "))
@ -21,11 +29,11 @@
(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" "") " "))))
((#\# 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))
@ -36,25 +44,34 @@
(text-widget-font "Fantasque Sans Mono-13:bold")
(text-widget-color "#ededed")
(text-widget-format string-maybe-pad-left)
(widget-background-color "#000000")
(text-widget-format text-maybe-pad-both)
(window
'position 'top
'position 'bottom
'width 1890
'margin-top 15
'margin-bottom 15
'margin-left 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: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"
(widget:text 'name "irclist"
'background-color "#3d3d3d")
(widget:spacer 'width 5)
(widget:text 'name "email"
'format (compose text-maybe-pad-both (add-fa-icon ""))
'background-color "#3d3d3d")
(widget:spacer 'width 5)
(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))
'background-color "#3d3d3d")
(widget:spacer 'width 5)
(widget:clock 'background-color "#3d3d3d"))

View file

@ -18,6 +18,12 @@ kupfer --no-splash &
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)
# exec ~/.local/share/quicklisp/local-projects/stumpwm/stumpwm