1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/modules/temperature.hpp

39 lines
839 B
C++
Raw Normal View History

#pragma once
#include <istream>
#include "config.hpp"
2016-11-20 17:04:31 -05:00
#include "modules/meta/timer_module.hpp"
2016-11-19 00:22:44 -05:00
POLYBAR_NS
namespace modules {
enum class temp_state { NORMAL = 0, WARN };
class temperature_module : public timer_module<temperature_module> {
public:
explicit temperature_module(const bar_settings&, string);
bool update();
string get_format() const;
2016-11-25 07:55:15 -05:00
bool build(builder* builder, const 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>";
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;
string m_path;
2016-11-11 13:35:08 -05:00
int m_zone = 0;
int m_tempwarn = 0;
int m_temp = 0;
int m_perc = 0;
};
}
2016-11-19 00:22:44 -05:00
POLYBAR_NS_END