diff --git a/configs/aerc.nix b/configs/aerc.nix index c851ab8..d4fa5cf 100644 --- a/configs/aerc.nix +++ b/configs/aerc.nix @@ -113,29 +113,6 @@ in { imap.host = "mail.cock.li"; smtp.host = imap.host; }; - google-amro = - defaults - // rec { - address = "amroplay@gmail.com"; - userName = address; - passwordCommand = passwordCommandFrom ; - flavor = "gmail.com"; - aerc.enable = false; - }; - google-kieran = - defaults - // rec { - address = "kieran.meinhardt@gmail.com"; - userName = address; - passwordCommand = passwordCommandFrom ; - flavor = "gmail.com"; - aerc.enable = false; - folders = { - drafts = "[Gmail]/Entwürfe"; - sent = "[Gmail]/Gesendet"; - trash = "[Gmail]/Papierkorb"; - }; - }; posteo = lib.recursiveUpdate defaults rec { diff --git a/configs/i3.nix b/configs/i3.nix index 5d4e896..ad46680 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -178,6 +178,7 @@ in { statusCommand = "env I3RS_GITHUB_TOKEN=${lib.strings.fileContents } ${pkgs.i3status-rust}/bin/i3status-rs ${ (pkgs.formats.toml {}).generate "i3status-rust.toml" (import { inherit (config.niveum) batteryName wirelessInterface; + inherit (config.home-manager.users.me.accounts.email) accounts; inherit colours; inherit pkgs; }) diff --git a/lib/i3status-rust.nix b/lib/i3status-rust.nix index ceffd4e..0f2c0ed 100644 --- a/lib/i3status-rust.nix +++ b/lib/i3status-rust.nix @@ -3,6 +3,7 @@ wirelessInterface, colours, batteryName, + accounts, }: let inherit (pkgs) lib; @@ -10,8 +11,6 @@ pkgs.writers.writeDash "setsid-command" '' ${pkgs.util-linux}/bin/setsid ${script} ''; - - accounts = import {inherit lib;}; in { theme = { name = "plain"; @@ -114,7 +113,8 @@ in { interval = 60 * 5; command = let query-account = name: account: "${pkgs.writers.writeDash "query-imap-${name}" '' - ${pkgs.coreutils}/bin/timeout 1 ${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg "${account.user}:${account.password}"} imaps://${account.imap} -X 'STATUS INBOX (UNSEEN)' \ + password=$(${toString account.passwordCommand}) + ${pkgs.coreutils}/bin/timeout 1 ${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg account.userName}:"$password" imaps://${account.imap.host} -X 'STATUS INBOX (UNSEEN)' \ | ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' \ | sed 's/^/{"${name}":/;s/$/}/' ''} &"; @@ -130,7 +130,7 @@ in { text: (if $sum > 0 then $sum | tostring else "" end), icon: "mail", state: ( - if .uni > 0 or .["work-uni"] > 0 or .posteo > 0 then + if .["hu-student"] > 0 or .["hu-employee"] > 0 or .posteo > 0 then "Warning" elif $sum > 0 then "Info"