mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Add idle inhibitor module
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <gtkmm/window.h>
|
||||
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
#include "idle-inhibit-unstable-v1-client-protocol.h"
|
||||
#include "IModule.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
@ -24,6 +24,7 @@ class Client {
|
||||
struct zwlr_layer_shell_v1 *layer_shell = nullptr;
|
||||
struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
|
||||
struct wl_seat *seat = nullptr;
|
||||
struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr;
|
||||
std::vector<std::unique_ptr<Bar>> bars;
|
||||
|
||||
private:
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "modules/sway/workspaces.hpp"
|
||||
#include "modules/sway/window.hpp"
|
||||
#endif
|
||||
#include "modules/idle_inhibitor.hpp"
|
||||
#include "modules/battery.hpp"
|
||||
#include "modules/memory.hpp"
|
||||
#include "modules/cpu.hpp"
|
||||
|
23
include/modules/idle_inhibitor.hpp
Normal file
23
include/modules/idle_inhibitor.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "bar.hpp"
|
||||
#include "client.hpp"
|
||||
#include "ALabel.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class IdleInhibitor: public ALabel {
|
||||
public:
|
||||
IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~IdleInhibitor();
|
||||
auto update() -> void;
|
||||
private:
|
||||
bool onClick(GdkEventButton* const& ev);
|
||||
|
||||
const Bar& bar_;
|
||||
std::string status_;
|
||||
struct zwp_idle_inhibitor_v1 *idle_inhibitor_;
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user