From 69a4b18297ad5b30a6a6bd9064a8d7de5b648fb5 Mon Sep 17 00:00:00 2001 From: Peter Date: Sat, 25 Dec 2021 19:22:15 +0000 Subject: Replace hard-coded mail server address with rbw lookup --- .config/sway/i3blocks_modules | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.config/sway') diff --git a/.config/sway/i3blocks_modules b/.config/sway/i3blocks_modules index ad4bbba..2bc6ed5 100755 --- a/.config/sway/i3blocks_modules +++ b/.config/sway/i3blocks_modules @@ -41,8 +41,9 @@ case "$1" in ;; mail) check_online - mail_password=$(rbw get 'yandex mail') - mail_count=$(curl --silent --netrc-file <(cat <<<"machine $MAILSERVER login $EMAIL password $mail_password") "imaps://$MAILSERVER" -X 'STATUS INBOX (UNSEEN)') + mail_server=$(rbw get 'email' --full | awk -F: '/Incoming/ {gsub(/ /,""); print $2}') + mail_password=$(rbw get 'email') + mail_count=$(curl --silent --netrc-file <(cat <<<"machine $mail_server login $EMAIL password $mail_password") "imaps://$MAILSERVER" -X 'STATUS INBOX (UNSEEN)') printf " %s\n" "$(printf "$mail_count" | awk -F"[][()]" '{print substr ($2, 8 )}')" ;; power) -- cgit v1.2.3