show the number of unread mail in i3bar

This commit is contained in:
Bruno Carlin 2020-06-16 07:09:08 +02:00
parent 264d10b02d
commit d66a19b62e
5 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
fd -t f . "$HOME/.cache/mail/waarp/INBOX/new/" | wc -l > "$HOME/.cache/mail/waarp.unreadcount"

View file

@ -22,6 +22,7 @@ order += "battery all"
order += "volume master" order += "volume master"
order += "load" order += "load"
order += "cpu_usage" order += "cpu_usage"
order += "read_file unreadmail"
order += "tztime local" order += "tztime local"
wireless _first_ { wireless _first_ {
@ -70,3 +71,9 @@ disk "/" {
disk "/home" { disk "/home" {
format = "  %avail (%percentage_avail)" format = "  %avail (%percentage_avail)"
} }
read_file unreadmail {
path = "/home/bca/.cache/mail/waarp.unreadcount"
format = " %content"
Max_characters = 10
}

View file

@ -0,0 +1 @@
/home/bca/.config/systemd/user/update-mail-count.timer

View file

@ -0,0 +1,6 @@
[Unit]
Description=Update mail count for display in i3status
[Service]
Type=oneshot
ExecStart=/home/bca/.local/bin/update-mail-count

View file

@ -0,0 +1,11 @@
[Unit]
Description=mail count timer
[Timer]
OnBootSec=1m
OnUnitActiveSec=1m
Persistent=true
Unit=update-mail-count.service
[Install]
WantedBy=timers.target