2016-11-10 06:52:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <istream>
|
|
|
|
|
2017-01-11 02:07:28 +00:00
|
|
|
#include "settings.hpp"
|
2016-11-20 22:04:31 +00:00
|
|
|
#include "modules/meta/timer_module.hpp"
|
2016-11-10 06:52:11 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS
|
2016-11-10 06:52:11 +00:00
|
|
|
|
|
|
|
namespace modules {
|
|
|
|
enum class temp_state { NORMAL = 0, WARN };
|
|
|
|
|
|
|
|
class temperature_module : public timer_module<temperature_module> {
|
|
|
|
public:
|
2016-12-21 07:00:09 +00:00
|
|
|
explicit temperature_module(const bar_settings&, string);
|
2016-11-10 06:52:11 +00:00
|
|
|
|
|
|
|
bool update();
|
|
|
|
string get_format() const;
|
2016-11-25 12:55:15 +00:00
|
|
|
bool build(builder* builder, const string& tag) const;
|
2016-11-10 06:52:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static constexpr auto TAG_LABEL = "<label>";
|
|
|
|
static constexpr auto TAG_LABEL_WARN = "<label-warn>";
|
2016-11-11 18:35:08 +00:00
|
|
|
static constexpr auto TAG_RAMP = "<ramp>";
|
2016-11-10 06:52:11 +00:00
|
|
|
static constexpr auto FORMAT_WARN = "format-warn";
|
|
|
|
|
|
|
|
map<temp_state, label_t> m_label;
|
2016-11-11 18:35:08 +00:00
|
|
|
ramp_t m_ramp;
|
2016-11-10 06:52:11 +00:00
|
|
|
|
|
|
|
string m_path;
|
2016-11-11 18:35:08 +00:00
|
|
|
int m_zone = 0;
|
|
|
|
int m_tempwarn = 0;
|
2016-11-10 06:52:11 +00:00
|
|
|
int m_temp = 0;
|
2016-11-14 16:56:29 +00:00
|
|
|
int m_perc = 0;
|
2016-11-10 06:52:11 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|