summaryrefslogtreecommitdiff
path: root/email-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2017-02-01 22:00:45 -0500
committerstreetturtle <streetturtle@gmail.com>2017-02-01 22:00:45 -0500
commit7c28ded77ed3019041553155bd920a702f2b1855 (patch)
tree36815ccd51f9efb95c53873ab1cf1a0794af93e2 /email-widget
parenta660bf46551a5e188150af3e82bba018f4519543 (diff)
email readme update
Diffstat (limited to 'email-widget')
-rw-r--r--email-widget/README.md35
-rw-r--r--email-widget/email.lua4
2 files changed, 37 insertions, 2 deletions
diff --git a/email-widget/README.md b/email-widget/README.md
new file mode 100644
index 0000000..9d532a0
--- /dev/null
+++ b/email-widget/README.md
@@ -0,0 +1,35 @@
+# Email widget
+
+This widget consists of an icon with counter which shows number of unread emails: ![email icon](./em-wid-1.png)
+and a popup message which appears when mouse hovers over an icon: ![email popup](./em-wid-1.png)
+
+Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
+
+## Installation
+
+To install it put **email.lua** and **email-widget** folder under **~/.config/awesome**. Then
+
+ - in **email.lua** cahnge path to python scripts;
+ - in python scripts add your credentials (note that password should be encrypted using pgp for example);
+ - add widget to awesome:
+
+```lua
+require("email")
+...
+s.mytasklist, -- Middle widget
+ { -- Right widgets
+ layout = wibox.layout.fixed.horizontal,
+ ...
+ email_icon,
+ email_widget,
+ ...
+```
+
+## How it works
+
+This widget uses the output of two python scripts, first is called every 20 seconds - it returns number of unread emails and second is called when mouse hovers over an icon and displays content of those emails. For both of them you'll need to provide your credentials and imap server. For testing they can simply be called from console:
+
+``` bash
+python ~/.config/awesome/email/count_unread_emails.py
+python ~/.config/awesome/email/read_emails.py
+``` \ No newline at end of file
diff --git a/email-widget/email.lua b/email-widget/email.lua
index cee74e8..10027d1 100644
--- a/email-widget/email.lua
+++ b/email-widget/email.lua
@@ -12,7 +12,7 @@ email_icon = wibox.widget.imagebox()
email_icon:set_image(path_to_icons .. "/mail-mark-new.png")
watch(
- "python /home/<username>/.config/awesome/email/count_unread_emails.py", 20,
+ "python /home/<username>/.config/awesome/email-widget/count_unread_emails.py", 20,
function(widget, stdout, stderr, exitreason, exitcode)
local unread_emails_num = tonumber(stdout)
if (unread_emails_num > 0) then
@@ -27,7 +27,7 @@ watch(
function show_emails()
- awful.spawn.easy_async([[bash -c 'python /home/<username>/.config/awesome/email/read_unread_emails.py']],
+ awful.spawn.easy_async([[bash -c 'python /home/<username>/.config/awesome/email-widget/read_unread_emails.py']],
function(stdout, stderr, reason, exit_code)
naughty.notify{
text = stdout,