2021-12-03 23:32:53 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gio/gio.h>
|
|
|
|
|
2022-04-06 08:37:19 +02:00
|
|
|
#include <memory>
|
|
|
|
|
2021-12-03 23:32:53 +01:00
|
|
|
#include "ALabel.hpp"
|
|
|
|
#include "bar.hpp"
|
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
|
|
|
class Inhibitor : public ALabel {
|
|
|
|
public:
|
|
|
|
Inhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
|
|
|
|
~Inhibitor() override;
|
|
|
|
auto update() -> void;
|
|
|
|
auto activated() -> bool;
|
|
|
|
|
|
|
|
private:
|
|
|
|
auto handleToggle(::GdkEventButton* const& e) -> bool;
|
|
|
|
|
2022-04-06 08:37:19 +02:00
|
|
|
const std::unique_ptr<::GDBusConnection, void (*)(::GDBusConnection*)> dbus_;
|
2021-12-03 23:32:53 +01:00
|
|
|
const std::string inhibitors_;
|
|
|
|
int handle_ = -1;
|
|
|
|
};
|
|
|
|
|
2022-04-06 08:37:19 +02:00
|
|
|
} // namespace waybar::modules
|