PANEL: Show random todo item with color in panel

This commit is contained in:
Tom Willemsen 2011-12-28 15:35:24 +01:00
parent 702171d074
commit c5a93f2de6

View file

@ -66,7 +66,10 @@ herbstclient pad $monitor $height
gmail=`ls ~/documents/mail/gmail/INBOX/new/ | wc -l` gmail=`ls ~/documents/mail/gmail/INBOX/new/ | wc -l`
archmail=`ls ~/documents/mail/arch/INBOX/new/ | wc -l` archmail=`ls ~/documents/mail/arch/INBOX/new/ | wc -l`
aethonmail=`ls ~/documents/mail/aethon/INBOX/new/ | wc -l` aethonmail=`ls ~/documents/mail/aethon/INBOX/new/ | wc -l`
right="$separator 9f: $nfmail $separator gmail: $gmail $separator arch: $archmail $separator aethon: $aethonmail $separator^bg($hintcolor) $date $separator" todoline=`cat ~/.config/herbstluftwm/todo`
todoline_sha1=`echo $todoline | sha1sum`
todoline_color=${todoline_sha1:0:6}
right="^fg(#$todoline_color)$todoline^fg() $separator 9f: $nfmail $separator gmail: $gmail $separator arch: $archmail $separator aethon: $aethonmail $separator^bg($hintcolor) $date $separator"
right_text_only=$(echo -n "$right"|sed 's.\^[^(]*([^)]*)..g') right_text_only=$(echo -n "$right"|sed 's.\^[^(]*([^)]*)..g')
# get width of right aligned text.. and add some space.. # get width of right aligned text.. and add some space..
width=$(textwidth "$font" "$right_text_only ") width=$(textwidth "$font" "$right_text_only ")