From 0dba3abc1d4e1d220bec5361016a24a921dd5726 Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 21 Aug 2018 10:50:09 +0200 Subject: [PATCH] fix(custom): do not take the custom module ref --- include/modules/custom.hpp | 4 ++-- resources/config | 4 ++-- src/modules/battery.cpp | 2 +- src/modules/custom.cpp | 2 +- src/modules/network.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/modules/custom.hpp b/include/modules/custom.hpp index 52cd6514..dcab363c 100644 --- a/include/modules/custom.hpp +++ b/include/modules/custom.hpp @@ -10,12 +10,12 @@ namespace waybar::modules { class Custom : public ALabel { public: - Custom(const std::string&, const Json::Value&); + Custom(const std::string, const Json::Value&); auto update() -> void; private: void worker(); - const std::string& name_; + const std::string name_; waybar::util::SleeperThread thread_; }; diff --git a/resources/config b/resources/config index 03e028b3..772bda4e 100644 --- a/resources/config +++ b/resources/config @@ -1,5 +1,5 @@ { - // "layer": "top", // Waybar at top layer + "layer": "top", // Waybar at top layer // "position": "bottom", // Waybar at the bottom of your screen // "height": 30, // Waybar height // "width": 1280, // Waybar width @@ -46,7 +46,7 @@ "custom/spotify": { "format": " {}", "max-length": 40, - "exec": "$HOME/.bin/mediaplayer.sh", + "exec": "$HOME/.config/waybar/mediaplayer.sh", "exec-if": "pgrep spotify" } } diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 5372665a..e0d4895b 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -35,7 +35,7 @@ waybar::modules::Battery::~Battery() void waybar::modules::Battery::worker() { // Trigger first values - dp.emit(); + update(); thread_ = [this] { struct inotify_event event = {0}; int nbytes = read(fd_, &event, sizeof(event)); diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 10670341..181aaf2b 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -1,6 +1,6 @@ #include "modules/custom.hpp" -waybar::modules::Custom::Custom(const std::string& name, +waybar::modules::Custom::Custom(const std::string name, const Json::Value& config) : ALabel(config), name_(name) { diff --git a/src/modules/network.cpp b/src/modules/network.cpp index d6980920..0743cebb 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -31,7 +31,7 @@ waybar::modules::Network::Network(const Json::Value& config) label_.set_name("network"); // Trigger first values getInfo(); - dp.emit(); + update(); thread_ = [this] { char buf[4096]; uint64_t len = netlinkResponse(sock_fd_, buf, sizeof(buf),