From 47819d5580687bbba40c8060bdf743920be5a15d Mon Sep 17 00:00:00 2001 From: samedamci Date: Thu, 14 May 2020 11:13:54 +0200 Subject: [PATCH] Add new 'mails' bar module --- .local/bin/scripts/dwmbar/mails | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 .local/bin/scripts/dwmbar/mails diff --git a/.local/bin/scripts/dwmbar/mails b/.local/bin/scripts/dwmbar/mails new file mode 100755 index 0000000..9f853fb --- /dev/null +++ b/.local/bin/scripts/dwmbar/mails @@ -0,0 +1,9 @@ +#!/bin/sh + +# Modified Luke Smith's script. + +unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" + +icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" + +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo " $unread$icon"