waybar/include/modules/inhibitor.hpp

28 lines
575 B
C++
Raw Permalink Normal View History

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