bar: Make module separator a label

Some people use text modules instead of the `separator` key in the bar
section to better configure the separator (colors, fonts).
Since we disallowed the same module being used multiple times in ,
this will now print an error message.

This should help with this a bit.

Ref 
This commit is contained in:
patrick96 2019-10-27 13:32:45 +01:00 committed by Patrick Ziegler
parent a77923ea96
commit 587dc6c84d
7 changed files with 14 additions and 16 deletions
src/components

View file

@ -3,6 +3,7 @@
#include <csignal>
#include "components/bar.hpp"
#include "components/builder.hpp"
#include "components/config.hpp"
#include "components/ipc.hpp"
#include "components/logger.hpp"
@ -447,12 +448,15 @@ void controller::process_inputdata() {
bool controller::process_update(bool force) {
const bar_settings& bar{m_bar->settings()};
string contents;
string separator{bar.separator};
string padding_left(bar.padding.left, ' ');
string padding_right(bar.padding.right, ' ');
string margin_left(bar.module_margin.left, ' ');
string margin_right(bar.module_margin.right, ' ');
builder build{bar};
build.node(bar.separator);
string separator{build.flush()};
for (const auto& block : m_blocks) {
string block_contents;
bool is_left = false;