dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 424a03e944d4d8ac361e9eb2989f01084b5b0f93
parent 2b355e6fa0085e9ef2e1c27e830ac383bc50bea8
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 20 Dec 2018 11:03:32 +0100

Colorize mail status for i3blocks

Diffstat:
Mlinks/.config/i3/i3scripts/i3mail | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/links/.config/i3/i3scripts/i3mail b/links/.config/i3/i3scripts/i3mail @@ -14,5 +14,12 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -mailstatus=$(mailstatus.sh | sed 's/\#\[.*]//') -echo $mailstatus +mailstatus="$(mailstatus.sh | sed 's/\#\[.*]M: //')" + +if [[ "$mailstatus" =~ '0' ]]; then + color="#ffffff" +else + color="#fabd2f" +fi + +printf "M: <span color=\"%s\">%s</span>" "$color" "$mailstatus"