You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: email-widget/README.md
+31-13Lines changed: 31 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,34 +3,52 @@
3
3
This widget consists of an icon with counter which shows number of unread emails: 
4
4
and a popup message which appears when mouse hovers over an icon: 
5
5
6
-
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.
7
-
8
6
## Installation
7
+
1. Clone this repository to your awesome config folder:
9
8
10
-
To install it put **email.lua** and **email-widget** folder under **~/.config/awesome**. Then
2. Make virtual environment and install dependencies:
11
13
12
-
- in **email.lua** change path to python scripts;
13
-
- in python scripts add your credentials (note that password should be encrypted using pgp for example);
14
-
- add widget to awesome:
14
+
```bash
15
+
cd~/.config/awesome/email-widget
16
+
python3 -m venv venv
17
+
source venv/bin/activate
18
+
pip install -r requirements.txt
19
+
```
20
+
3. Fill .env file with your credentials:
15
21
16
-
```lua
17
-
localemail_widget, email_icon=require("email")
22
+
```bash
23
+
cp .env.example .env
24
+
```
25
+
4. Add widget to awesome:
18
26
27
+
```lua
28
+
localemail_widget=require("email-widget.email")
19
29
...
20
30
s.mytasklist, -- Middle widget
21
31
{ -- Right widgets
22
-
layout=wibox.layout.fixed.horizontal,
32
+
layout=wibox.layout.fixed.horizontal,
23
33
...
24
-
email_icon,
25
-
email_widget,
34
+
email_widget,
26
35
...
27
36
```
28
37
38
+
If you want to reduce time of getting emails, you can change maximum number of emails to be fetched in .env file. Default is 10.
39
+
If you want to configure width of popup window, you can change this line in email.lua file:
40
+
41
+
```lua
42
+
width=800,
43
+
```
44
+
After this you can change MAX_BODY_LENGTH variable in .env file to change number of characters to be displayed in popup window. Default is 100.
45
+
Next step is restarting awesome. You can do this by pressing Mod+Ctrl+r.
46
+
29
47
## How it works
30
48
31
49
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:
0 commit comments