-
-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
- Loading branch information
1 parent
7e61e5f
commit d3e32d1
Showing
8 changed files
with
75 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
#pragma once | ||
|
||
#include <gio/gio.h> | ||
|
||
#include <memory> | ||
|
||
#include "ALabel.hpp" | ||
#include "bar.hpp" | ||
|
||
namespace waybar::modules { | ||
|
||
class Inhibitor : public ALabel { | ||
class Inhibitor final : public ALabel { | ||
public: | ||
Inhibitor(const std::string&, const waybar::Bar&, const Json::Value&); | ||
Inhibitor(const std::string&, const Json::Value&); | ||
virtual ~Inhibitor(); | ||
auto update() -> void override; | ||
auto doAction(const std::string& name) -> void override; | ||
auto activated() -> bool; | ||
|
||
private: | ||
auto handleToggle(::GdkEventButton* const& e) -> bool override; | ||
|
||
const std::unique_ptr<::GDBusConnection, void (*)(::GDBusConnection*)> dbus_; | ||
const std::string inhibitors_; | ||
int handle_ = -1; | ||
// Module actions | ||
void toggle(); | ||
// Module Action Map | ||
static inline std::map<const std::string, void (waybar::modules::Inhibitor::*const)()> actionMap_{ | ||
{"toggle", &waybar::modules::Inhibitor::toggle}}; | ||
}; | ||
|
||
} // namespace waybar::modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#pragma once | ||
#include <gtkmm/icontheme.h> | ||
#include <gdkmm/pixbuf.h> | ||
|
||
#include <mutex> | ||
#include <string> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters