sway: No mostrar códigos de colores en barra
This commit is contained in:
parent
b98aadda04
commit
7bcde0ecb0
1 changed files with 6 additions and 1 deletions
|
@ -2,13 +2,18 @@
|
||||||
|
|
||||||
. ~/.profile
|
. ~/.profile
|
||||||
|
|
||||||
|
# https://stackoverflow.com/a/54547589
|
||||||
|
strip() {
|
||||||
|
cat /dev/stdin | sed $'s/\e\\[[0-9;:]*[a-zA-Z]//g'
|
||||||
|
}
|
||||||
|
|
||||||
i3status | while true; do
|
i3status | while true; do
|
||||||
read line
|
read line
|
||||||
json_array="$(echo $line | grep -F [{ | sed -e 's/^,//')"
|
json_array="$(echo $line | grep -F [{ | sed -e 's/^,//')"
|
||||||
if test -z "$json_array"; then
|
if test -z "$json_array"; then
|
||||||
echo "$line"
|
echo "$line"
|
||||||
else
|
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] + .")"
|
json_array="$(echo $json_array | jq ". |= [$zeit_obj] + .")"
|
||||||
echo "$json_array,"
|
echo "$json_array,"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue