dwmblocks scripts.
This commit is contained in:
parent
d25a6431fb
commit
24dd7f46c9
6 changed files with 97 additions and 0 deletions
16
_suckless/_scripts/sb-mail
Executable file
16
_suckless/_scripts/sb-mail
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ ! -e ~/.local/share/passwords ] && echo "no accounts configured" && exit 1
|
||||
|
||||
unread=0
|
||||
cat ~/.local/share/passwords | while read line; do
|
||||
user=$(echo "$line" | awk '{print $1}')
|
||||
pass=$(echo "$line" | awk '{print $1}')
|
||||
count=$(curl -s --user "${uers}:${pass}" https://mail.google.com/mail/feed/atom/ | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
|
||||
[ $count -ne 0 ] && unread=$((unread + count))
|
||||
if [ $user = 'ftpd@insomniac.pl' ]; then
|
||||
count=$(curl -s --user "${i}:${pass}" https://mail.google.com/mail/feed/atom/sites | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
|
||||
[ $count -ne 0 ] && unread=$((unread + count))
|
||||
fi
|
||||
done
|
||||
[ "$unread" = "0" ] && echo "no new mail" || echo "^c#161616^^b#fd4285^new mail: ${unread}^d^"
|
Loading…
Add table
Add a link
Reference in a new issue