sway: No mostrar códigos de colores en barra

This commit is contained in:
Cat /dev/Nulo 2022-03-27 13:44:12 -03:00
parent b98aadda04
commit 7bcde0ecb0

View file

@ -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