Fix email i3block

This commit is contained in:
Alexander Bantyev 2021-01-26 22:19:54 +03:00
parent f1d4266cb4
commit d4c9ab3eb8
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
2 changed files with 12 additions and 2 deletions

View File

@ -8,6 +8,12 @@ in {
services = [ ];
};
secrets.email = {
owner = "balsoft:users";
services = [ ];
encrypted = "/home/balsoft/.password-store/email/balsoft@balsoft.ru.gpg";
};
home-manager.users.balsoft = {
wayland.windowManager.sway.config.bars = [{
id = "default";
@ -64,7 +70,10 @@ in {
(scrint "time" 1)
]);
systemd.user.services.swaybar = {
Unit = { Description = "Start default bar"; };
Unit = {
Description = "Start default bar";
X-RestartIfChanged = true;
};
Install.WantedBy = [ "sway-session.target" ];

View File

@ -2,7 +2,8 @@
#!${python3}/bin/python3
import imaplib
obj = imaplib.IMAP4_SSL('balsoft.ru', 993)
obj.login("balsoft@balsoft.ru", "${config.secrets.gnome-keyring-envsubst-email.decrypted}")
password = open("${config.secrets.email.decrypted}").read()[:-1:]
obj.login("balsoft@balsoft.ru", password)
obj.select()
l = len(obj.search(None, 'unseen')[1][0].split())
if l == 0: