update from master
This commit is contained in:
parent
b7df991deb
commit
42ccddb21f
|
@ -6,34 +6,52 @@ layout: page
|
||||||
This widget consists of an icon with counter which shows number of unread emails: ![email icon](../awesome-wm-widgets/assets/img/widgets/screenshots/email-widget/em-wid-1.png)
|
This widget consists of an icon with counter which shows number of unread emails: ![email icon](../awesome-wm-widgets/assets/img/widgets/screenshots/email-widget/em-wid-1.png)
|
||||||
and a popup message which appears when mouse hovers over an icon: ![email popup](../awesome-wm-widgets/assets/img/widgets/screenshots/email-widget/em-wid-2.png)
|
and a popup message which appears when mouse hovers over an icon: ![email popup](../awesome-wm-widgets/assets/img/widgets/screenshots/email-widget/em-wid-2.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
|
## Installation
|
||||||
|
1. Clone this repository to your awesome config folder:
|
||||||
|
|
||||||
To install it put **email.lua** and **email-widget** folder under **~/.config/awesome**. Then
|
```bash
|
||||||
|
git clone https://github.com/streetturtle/awesome-wm-widgets/email-widget ~/.config/awesome/email-widget
|
||||||
|
```
|
||||||
|
2. Make virtual environment and install dependencies:
|
||||||
|
|
||||||
- in **email.lua** change path to python scripts;
|
```bash
|
||||||
- in python scripts add your credentials (note that password should be encrypted using pgp for example);
|
cd ~/.config/awesome/email-widget
|
||||||
- add widget to awesome:
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
3. Fill .env file with your credentials:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
4. Add widget to awesome:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local email_widget, email_icon = require("email")
|
local email_widget = require("email-widget.email")
|
||||||
|
|
||||||
...
|
...
|
||||||
s.mytasklist, -- Middle widget
|
s.mytasklist, -- Middle widget
|
||||||
{ -- Right widgets
|
{ -- Right widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
...
|
...
|
||||||
email_icon,
|
email_widget,
|
||||||
email_widget,
|
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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.
|
||||||
|
If you want to configure width of popup window, you can change this line in email.lua file:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
width = 800,
|
||||||
|
```
|
||||||
|
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.
|
||||||
|
Next step is restarting awesome. You can do this by pressing Mod+Ctrl+r.
|
||||||
|
|
||||||
## How it works
|
## 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:
|
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
|
``` bash
|
||||||
python ~/.config/awesome/email/count_unread_emails.py
|
python ~/.config/awesome/email-widget/count_unread_emails.py
|
||||||
python ~/.config/awesome/email/read_emails.py
|
python ~/.config/awesome/email-widget/read_emails.py
|
||||||
```
|
```
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 855 B |
Binary file not shown.
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue