From 1d85769bc7fab79f2603ca93ed2673bd49d72132 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 5 Apr 2022 13:45:33 -0300 Subject: [PATCH] =?UTF-8?q?i3status-wrapper:=20Solo=20poner=20en=20rojo=20?= =?UTF-8?q?cuando=20est=C3=A1=20trackeando?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/sway/i3status-wrapper | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/sway/i3status-wrapper b/.config/sway/i3status-wrapper index 488b4dd..1f2de5c 100755 --- a/.config/sway/i3status-wrapper +++ b/.config/sway/i3status-wrapper @@ -8,7 +8,13 @@ i3status | while true; do if test -z "$json_array"; then echo "$line" else - zeit_obj='{"name":"zeit","instance":"zeit","color":"#FF0000","markup":"none","full_text":"'$(zeit tracking --no-colors)'"}' + zeit="$(zeit tracking --no-colors)" + if echo "$zeit" | grep -F tracking >/dev/null; then + color="#FF0000" + else + color="#000000" + fi + zeit_obj='{"name":"zeit","instance":"zeit","color":"'$color'","markup":"none","full_text":"'$zeit'"}' json_array="$(echo $json_array | jq ". |= [$zeit_obj] + .")" echo "$json_array," fi