Add temperature module

This commit is contained in:
Groggy
2019-03-13 13:18:08 +01:00
parent cd13180199
commit 7ae549dc9e
7 changed files with 97 additions and 2 deletions

View File

@ -23,6 +23,7 @@
#ifdef HAVE_LIBPULSE
#include "modules/pulseaudio.hpp"
#endif
#include "modules/temperature.hpp"
#include "modules/custom.hpp"
namespace waybar {

View File

@ -0,0 +1,23 @@
#pragma once
#include <fmt/format.h>
#include <fstream>
#include "util/sleeper_thread.hpp"
#include "ALabel.hpp"
namespace waybar::modules {
class Temperature : public ALabel {
public:
Temperature(const std::string&, const Json::Value&);
~Temperature() = default;
auto update() -> void;
private:
std::tuple<uint16_t, uint16_t> getTemperature();
bool isCritical(uint16_t);
std::string file_path_;
waybar::util::SleeperThread thread_;
};
}