feat(ALabel): Toggleable labels

This commit is contained in:
Alexis
2018-08-27 01:36:25 +02:00
parent e9478f548e
commit 53956d9d18
13 changed files with 75 additions and 63 deletions

View File

@ -1,7 +1,7 @@
#include "modules/network.hpp"
waybar::modules::Network::Network(const Json::Value& config)
: ALabel(config), family_(AF_INET),
: ALabel(config, "{ifname}"), family_(AF_INET),
signal_strength_dbm_(0), signal_strength_(0)
{
sock_fd_ = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
@ -82,7 +82,7 @@ waybar::modules::Network::~Network()
auto waybar::modules::Network::update() -> void
{
auto format = config_["format"] ? config_["format"].asString() : "{ifname}";
auto format = format_;
if (ifid_ <= 0) {
format = config_["format-disconnected"]
? config_["format-disconnected"].asString() : format;