2019-02-10 09:35:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-11-24 11:28:52 +00:00
|
|
|
#include "ALabel.hpp"
|
2023-10-15 19:14:06 +00:00
|
|
|
#include "util/backlight_backend.hpp"
|
2019-02-10 09:35:19 +00:00
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
2024-02-27 20:17:50 +00:00
|
|
|
class Backlight final : public ALabel {
|
2019-04-18 15:52:00 +00:00
|
|
|
public:
|
2019-02-10 09:35:19 +00:00
|
|
|
Backlight(const std::string &, const Json::Value &);
|
2023-10-15 19:14:06 +00:00
|
|
|
virtual ~Backlight() = default;
|
2023-03-02 13:57:07 +00:00
|
|
|
auto update() -> void override;
|
2019-02-10 09:35:19 +00:00
|
|
|
|
2024-02-27 20:17:50 +00:00
|
|
|
private:
|
2022-04-06 06:37:19 +00:00
|
|
|
const std::string preferred_device_;
|
|
|
|
std::string previous_format_;
|
2023-10-15 19:14:06 +00:00
|
|
|
util::BacklightBackend backend;
|
2024-02-27 20:17:50 +00:00
|
|
|
|
|
|
|
bool handleScroll(double dx, double dy) override;
|
2019-02-10 09:35:19 +00:00
|
|
|
};
|
2024-02-27 20:17:50 +00:00
|
|
|
|
2019-04-18 15:52:00 +00:00
|
|
|
} // namespace waybar::modules
|