From 7bcde0ecb0ff4c9e5e00682a9199c2a374e0c737 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sun, 27 Mar 2022 13:44:12 -0300 Subject: [PATCH] =?UTF-8?q?sway:=20No=20mostrar=20c=C3=B3digos=20de=20colo?= =?UTF-8?q?res=20en=20barra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/sway/i3status-wrapper | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/sway/i3status-wrapper b/.config/sway/i3status-wrapper index a23f63f..7a5365a 100755 --- a/.config/sway/i3status-wrapper +++ b/.config/sway/i3status-wrapper @@ -2,13 +2,18 @@ . ~/.profile +# https://stackoverflow.com/a/54547589 +strip() { + cat /dev/stdin | sed $'s/\e\\[[0-9;:]*[a-zA-Z]//g' +} + i3status | while true; do read line json_array="$(echo $line | grep -F [{ | sed -e 's/^,//')" if test -z "$json_array"; then echo "$line" else - zeit_obj='{"name":"zeit","instance":"zeit","markup":"none","full_text":"'"$(zeit tracking)"'"}' + zeit_obj='{"name":"zeit","instance":"zeit","markup":"none","full_text":"'$(zeit tracking | strip)'"}' json_array="$(echo $json_array | jq ". |= [$zeit_obj] + .")" echo "$json_array," fi