From 2762e2fe9b51575ffc31d7fafb8ade489b4bae1b Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Mon, 8 Aug 2022 12:39:46 -0300 Subject: [PATCH] home/waybar: improve mail and tailscale-ping modules tailscale-ping now shows pings obtained through derps mail now shows an icon when syncing --- home/misterio/desktop/common/wayland-wm/waybar.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/home/misterio/desktop/common/wayland-wm/waybar.nix b/home/misterio/desktop/common/wayland-wm/waybar.nix index 26187c56..e6ae67cc 100644 --- a/home/misterio/desktop/common/wayland-wm/waybar.nix +++ b/home/misterio/desktop/common/wayland-wm/waybar.nix @@ -143,7 +143,7 @@ in showPingCompact = { host, icon }: "${icon} $ping_${host}"; showPingLarge = { host, icon }: "${icon} ${host}: $ping_${host}"; setPing = { host, ... }: '' - ping_${host}="$(timeout 2 tailscale ping -c 1 ${host} | cut -d ' ' -f8)" || ping_${host}="Disconnected" + ping_${host}="$(timeout 2 tailscale ping -c 1 --until-direct=false ${host} | cut -d ' ' -f8)" || ping_${host}="Disconnected" ''; in jsonOutput { @@ -171,7 +171,7 @@ in }; }; "custom/unread-mail" = { - interval = 10; + interval = 4; return-type = "json"; exec = jsonOutput { pre = '' @@ -186,6 +186,9 @@ in ) status="unread" fi + if pgrep mbsync &>/dev/null; then + status="syncing" + fi ''; text = "$count"; tooltip = "$subjects"; @@ -195,6 +198,7 @@ in format-icons = { "read" = ""; "unread" = ""; + "syncing" = ""; }; }; "custom/gpg-agent" = { @@ -266,7 +270,7 @@ in interval = 2; return-type = "json"; exec = jsonOutput { - pre = ''player="$(${playerctl} status -f "{{playerName}}" || echo "No players found" | cut -d '.' -f1)"''; + pre = ''player="$(${playerctl} status -f "{{playerName}}" 2>/dev/null || echo "No players found" | cut -d '.' -f1)"''; alt = "$player"; tooltip = "$player"; };