summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2019-02-04 20:10:00 -0500
committerstreetturtle <streetturtle@gmail.com>2019-02-04 20:10:00 -0500
commit7bab821f2080e2f8d8a6285e57824dc738e1e781 (patch)
tree7f4b526b16ace3e73e37d6bc0ee724fea6966234
parent86ab5aea40d2034021b53373993b8ed3eec38f7c (diff)
fix email widget script
-rw-r--r--email-widget/count_unread_emails.py8
-rwxr-xr-xrun-shell/scratch_6.sh13
2 files changed, 4 insertions, 17 deletions
diff --git a/email-widget/count_unread_emails.py b/email-widget/count_unread_emails.py
index f4d2b86..a843814 100644
--- a/email-widget/count_unread_emails.py
+++ b/email-widget/count_unread_emails.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
import imaplib
-import email
+import re
M=imaplib.IMAP4_SSL("mail.teenagemutantninjaturtles.com", 993)
M.login("mickey@tmnt.com","cowabunga")
@@ -9,8 +9,8 @@ M.login("mickey@tmnt.com","cowabunga")
status, counts = M.status("INBOX","(MESSAGES UNSEEN)")
if status == "OK":
- unread = counts[0].split()[4][:-1]
+ unread = re.search(r'UNSEEN\s(\d+)', counts[0].decode('utf-8')).group(1)
else:
- unread = "N/A"
+ unread = "N/A"
-print(unread) \ No newline at end of file
+print(unread)
diff --git a/run-shell/scratch_6.sh b/run-shell/scratch_6.sh
deleted file mode 100755
index 7edad8c..0000000
--- a/run-shell/scratch_6.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-
-#RES=$(xrandr --current | grep '*' | uniq | awk '{print $1}')
-RNDM=$(uuidgen)
-IMAGE="/tmp/i3lock-$RNDM.png"
-
-
-## blur
-#ffmpeg -loglevel panic -f x11grab -video_size 1920x1060 -y -i :0.0+0,20 -filter_complex "boxblur=9" -vframes 1 $IMAGE
-## pixelate
-ffmpeg -loglevel panic -f x11grab -video_size 1920x1060 -y -i :0.0+$1,20 -vf frei0r=pixeliz0r -vframes 1 $IMAGE
-
-echo $RNDM \ No newline at end of file