From c79942c0a952dd751f2f6ef2e774a6b430cdad53 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 21 Dec 2022 17:28:36 +0200 Subject: [PATCH] custom: Change external binary output format to TAB instead of newline --- man/waybar-custom.5.scd | 4 ++-- src/modules/custom.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/waybar-custom.5.scd b/man/waybar-custom.5.scd index 3d30859d..8abb3a89 100644 --- a/man/waybar-custom.5.scd +++ b/man/waybar-custom.5.scd @@ -124,11 +124,11 @@ This should look like this: The *class* parameter also accepts an array of strings. -If nothing or an invalid option is specified, Waybar expects i3blocks style output. Values are *newline* separated. +If nothing or an invalid option is specified, Waybar expects *Tab* delemited output. This should look like this: ``` -$text\\n$tooltip\\n$class* +$text\\t$tooltip\\t$class\\n* ``` *class* is a CSS class, to apply different styles in *style.css* diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 23dba38d..f14f7573 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -165,7 +165,7 @@ void waybar::modules::Custom::parseOutputRaw() { std::istringstream output(output_.out); std::string line; int i = 0; - while (getline(output, line)) { + while (getline(output, line, '\t')) { if (i == 0) { if (config_["escape"].isBool() && config_["escape"].asBool()) { text_ = Glib::Markup::escape_text(line);