waybar/include/modules/inhibitor.hpp
Alexis Cellier eae65099d0 Add logind feature, with its 'inhibitor' module
The logind feature adds a new inhibitor module which allows to acquire
the inhibitor locks that logind presents.

Signed-off-by: Alexis Cellier <kernelserror@gmail.com>
2021-12-12 17:52:26 +01:00

28 lines
556 B
C++

#pragma once
#include <memory>
#include <gio/gio.h>
#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;
const std::unique_ptr<::GDBusConnection, void(*)(::GDBusConnection*)> dbus_;
const std::string inhibitors_;
int handle_ = -1;
};
} // namespace waybar::modules