From 444b0ad2a07486ee3e8f2094275f4ef3f84791c2 Mon Sep 17 00:00:00 2001 From: jornmann Date: Sat, 9 Apr 2022 14:25:16 +0300 Subject: [PATCH] Add Gmail module --- config.sh | 1 + modules.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/config.sh b/config.sh index d47794d..9c5f972 100755 --- a/config.sh +++ b/config.sh @@ -20,4 +20,5 @@ #module_cpu "CPU: " " | " #module_battery "Battery: " " | " #module_todo "TODO: " " | " +#module_gmail "Unread: " " | " module_date "Date: " "" diff --git a/modules.sh b/modules.sh index 8b606e0..30c1a1e 100755 --- a/modules.sh +++ b/modules.sh @@ -59,3 +59,9 @@ module_todo() { todooutput="$(head -n 1 ~/.todo.txt)" [ "$todooutput" = "" ] || export bar="${bar}${1}${todooutput}${2}" } + +module_gmail() { + export user="youruser" + export pass="yourpass" + export bar="${bar}${1}$(echo 'user = ${USER}@gmail.com:${PASS}' | curl -sf -K- -X 'STATUS INBOX (UNSEEN)' imaps://imap.gmail.com/INBOX | tr -d -c '[:digit:]')%${2}" +}