~strahinja/dotfiles

45af39b14457e549c454984b6fbf84e7e50f5066 — Страхиња Радић 3 days ago 8852a4b
bin/pagecheck: Added notification

Signed-off-by: Страхиња Радић <contact@strahinja.org>
1 files changed, 4 insertions(+), 0 deletions(-)

M bin/pagecheck
M bin/pagecheck => bin/pagecheck +4 -0
@@ 45,6 45,8 @@ TMPFILE=$(mktemp --tmpdir -q pagecheck.XXXXX)
REGEXP=$1
URL=$2
EMAIL=$3
ICON=dialog-information
TITLE="$PROG: New update"

mkdir -p $CACHEDIR
touch $CACHEFILE


@@ 56,6 58,8 @@ if [ $(( $(wc -c $TMPFILE | cut -d' ' -f1) )) -gt 0 ]; then
		cat $TMPFILE | sed -e's/\\n/\n/g' | \
			sed "s/.\\{$WRAPWIDTH\\}/&\\n/g" > $NEWFILE
		print_new | neomutt -s "[$PROG] New update" $EMAIL
		BODY=$(print_new)
		notify-send -i $ICON "$TITLE" "$BODY"
		print_new
		cat $TMPFILE >> $CACHEFILE
	fi