2019-02-17 15:27:54 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fmt/format.h>
|
2019-04-18 17:52:00 +02:00
|
|
|
#include "ALabel.hpp"
|
2019-02-17 15:27:54 +01:00
|
|
|
#include "bar.hpp"
|
|
|
|
#include "client.hpp"
|
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
2019-04-18 17:52:00 +02:00
|
|
|
class IdleInhibitor : public ALabel {
|
|
|
|
public:
|
|
|
|
IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
|
|
|
|
~IdleInhibitor();
|
|
|
|
auto update() -> void;
|
2020-11-01 18:09:48 +01:00
|
|
|
static std::list<waybar::AModule*> idle_inhibitor_modules;
|
|
|
|
static std::string idle_inhibitor_status;
|
2019-04-18 17:52:00 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool handleToggle(GdkEventButton* const& e);
|
2019-02-17 15:27:54 +01:00
|
|
|
|
2019-04-18 17:52:00 +02:00
|
|
|
const Bar& bar_;
|
2020-11-01 14:38:58 +01:00
|
|
|
struct zwp_idle_inhibitor_v1* idle_inhibitor_;
|
2019-04-23 15:56:38 +02:00
|
|
|
int pid_;
|
2019-02-17 15:27:54 +01:00
|
|
|
};
|
|
|
|
|
2019-04-18 17:52:00 +02:00
|
|
|
} // namespace waybar::modules
|