#!/bin/sh # email module for status/stellar # load config module_config [ -z "$ITEM12_EMAIL_DIR" ] && ITEM12_EMAIL_DIR="$HOME/.local/share/mail" [ -e "$HOME/.config/speedwm/statusrc" ] && . $HOME/.config/speedwm/statusrc [ -z "$ICON" ] && ICON="$ITEM12_ICON" [ -z "$EMAIL_UNREADS" ] && EMAIL_UNREADS="$(find $ITEM12_EMAIL_DIR/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f >/tmp/module_email_data 2>/dev/null && wc -l /dev/null && SEND_NOTIF || echo "FATAL: libnotify not installed, can't send notification." exit 1 } # information itself PRINT() { [ "$ENABLE_ITEM12" != "true" ] && return echo "$ITEM12_SEPARATOR $ICON $EMAIL_UNREADS $ITEM12_UNREAD_TEXT" } # argument 1 case "$1" in "") CLICK ;; "--print-file") PRINT > /tmp/module_email ;; "--print") PRINT ;; "--click") CLICK ;; esac