From 4ba5a08a2635cc268a296c2ce6bfca36baa93e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 3 May 2020 00:17:09 +0200 Subject: [PATCH] feat(i3): add mail to bar, make into dock --- configs/i3.nix | 3 ++- dot/i3status-rust.nix | 41 ++++++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/configs/i3.nix b/configs/i3.nix index e6cb49a..9a7bf72 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -103,7 +103,8 @@ in with config.niveum; { bars = [{ workspaceButtons = false; fonts = [ "Monospace ${toString (config.niveum.fonts.size - 1)}" ]; - mode = "hide"; + mode = "dock"; + position = "top"; colors = rec { background = colours.background; separator = background; diff --git a/dot/i3status-rust.nix b/dot/i3status-rust.nix index 5e68cf0..6e38399 100644 --- a/dot/i3status-rust.nix +++ b/dot/i3status-rust.nix @@ -43,6 +43,7 @@ net_vpn = "🛡 "; toggle_off = "👎"; toggle_on = "👍"; + mail = "📧 "; volume_full = "🔊 "; volume_half = "🔉 "; volume_muted = "⛔"; @@ -60,7 +61,7 @@ } { block = "custom"; - interval = 60 * 60 * 60; # hourly + interval = 60 * 2; # every two minutes command = pkgs.writers.writeDash "corona" '' ${pkgs.curl}/bin/curl https://corona-stats.online/germany \ | ${pkgs.gnugrep}/bin/grep Germany \ @@ -69,16 +70,6 @@ | ${pkgs.gawk}/bin/awk -F'│' '{print "🤒 " $3 " 💀 " $5}' ''; } - { - block = "custom"; - interval = 2 * 60; - command = pkgs.writers.writeDash "rss" '' - ${pkgs.newsboat}/bin/newsboat -x print-unread | ${pkgs.gawk}/bin/awk '{ print "📰 " $1 }' - ''; - on_click = pkgs.writers.writeDash "updateNewsboat" '' - ${pkgs.newsboat}/bin/newsboat -x reload && ${pkgs.libnotify}/bin/notify-send newsboat "Feeds updated." - ''; - } { block = "custom"; interval = 20; @@ -91,6 +82,34 @@ ${pkgs.st}/bin/st -c floating -e ${pkgs.dash}/bin/dash -c "${pkgs.todo-txt-cli}/bin/todo.sh list && sleep 2" ''; } + { + block = "custom"; + interval = 30; + command = pkgs.writers.writeDash "rss-new" '' + ${pkgs.newsboat}/bin/newsboat --execute=print-unread | ${pkgs.gawk}/bin/awk '{ print "📰 " $1 }' + ''; + on_click = pkgs.writers.writeDash "rss-update" '' + ${pkgs.libnotify}/bin/notify-send newsboat "Updating feeds. ♻" \ + && ${pkgs.newsboat}/bin/newsboat --execute=reload \ + && ${pkgs.libnotify}/bin/notify-send newsboat "Feeds updated. 📰" + ''; + } + { + block = "custom"; + interval = 30; + command = pkgs.writers.writeDash "mail-new" '' + printf "%s " "📧" + for dir in /home/kfm/mail/*/Inbox/new + do + find "$dir" -type f | wc --lines + done | paste --serial --delimiters='/' - + ''; + on_click = pkgs.writers.writeDash "mail-update" '' + ${pkgs.libnotify}/bin/notify-send newsboat "Updating mail. ♻" \ + && ${pkgs.isync}/bin/mbsync -a \ + && ${pkgs.libnotify}/bin/notify-send newsboat "Mail updated. 📧" + ''; + } { block = "net"; device = wifi-interface;