2016-11-10 01:52:11 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <istream>
|
|
|
|
|
|
|
|
#include "config.hpp"
|
|
|
|
#include "modules/meta.hpp"
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-11-10 01:52:11 -05:00
|
|
|
|
|
|
|
namespace modules {
|
|
|
|
enum class temp_state { NORMAL = 0, WARN };
|
|
|
|
|
|
|
|
class temperature_module : public timer_module<temperature_module> {
|
|
|
|
public:
|
|
|
|
using timer_module::timer_module;
|
|
|
|
|
|
|
|
void setup();
|
|
|
|
bool update();
|
|
|
|
string get_format() const;
|
|
|
|
bool build(builder* builder, string tag) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static constexpr auto TAG_LABEL = "<label>";
|
|
|
|
static constexpr auto TAG_LABEL_WARN = "<label-warn>";
|
2016-11-11 13:35:08 -05:00
|
|
|
static constexpr auto TAG_RAMP = "<ramp>";
|
2016-11-10 01:52:11 -05:00
|
|
|
static constexpr auto FORMAT_WARN = "format-warn";
|
|
|
|
|
|
|
|
map<temp_state, label_t> m_label;
|
2016-11-11 13:35:08 -05:00
|
|
|
ramp_t m_ramp;
|
2016-11-10 01:52:11 -05:00
|
|
|
|
|
|
|
string m_path;
|
2016-11-11 13:35:08 -05:00
|
|
|
int m_zone = 0;
|
|
|
|
int m_tempwarn = 0;
|
2016-11-10 01:52:11 -05:00
|
|
|
int m_temp = 0;
|
2016-11-14 11:56:29 -05:00
|
|
|
int m_perc = 0;
|
2016-11-10 01:52:11 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|