dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 7d49675b1bd4a0af5af80491c90421558e906d81
parent 1ff9e6f10ce4415082bc9df1ac419cb41168176d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon,  4 Mar 2019 21:02:42 +0100

Fix xml output when color is not specified

Diffstat:
Mlinks/.config/i3/i3scripts/i3battery | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/links/.config/i3/i3scripts/i3battery b/links/.config/i3/i3scripts/i3battery @@ -32,7 +32,10 @@ if [[ "$status" = "Charging" ]] || [[ "$powerdraw" = " 0W" ]]; then powerdraw="" fi -printf "<span color='%s'>%s%s%s</span>%s" "$color" \ +echo -n "<span" +[[ "$color" != "" ]] && printf " color='%s'" "$color" + +printf ">%s%s%s</span>%s" \ "$(echo "$status" | \ sed -e "s/,//g;s/Discharging/BAT /;s/Charging/PWR /;s/Unknown//;s/Full//;s/ 0*/ /g;s/ :/ /g")" \ "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" "$time$powerdraw"