diff --git a/modules/workspace/i3blocks/default.nix b/modules/workspace/i3blocks/default.nix index 64f2cb9..ce2564b 100644 --- a/modules/workspace/i3blocks/default.nix +++ b/modules/workspace/i3blocks/default.nix @@ -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" ]; diff --git a/modules/workspace/i3blocks/scripts/email.nix b/modules/workspace/i3blocks/scripts/email.nix index e7e048b..2e0cab1 100644 --- a/modules/workspace/i3blocks/scripts/email.nix +++ b/modules/workspace/i3blocks/scripts/email.nix @@ -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: