Waybar/include/modules/inhibitor.hpp

28 lines
560 B
C++
Raw Normal View History

#pragma once
#include <gio/gio.h>
2022-04-06 06:37:19 +00:00
#include <memory>
#include "AButton.hpp"
#include "bar.hpp"
namespace waybar::modules {
class Inhibitor : public AButton {
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 06:37:19 +00:00
const std::unique_ptr<::GDBusConnection, void (*)(::GDBusConnection*)> dbus_;
const std::string inhibitors_;
int handle_ = -1;
};
2022-04-06 06:37:19 +00:00
} // namespace waybar::modules