mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Add more configuaration
This commit is contained in:
@ -6,8 +6,10 @@
|
||||
#else
|
||||
#include <fmt/chrono.h>
|
||||
#endif
|
||||
#include "ALabel.hpp"
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
extern "C" {
|
||||
#include <libevdev/libevdev.h>
|
||||
@ -15,16 +17,30 @@ extern "C" {
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class KeyboardState : public ALabel {
|
||||
class KeyboardState : public AModule {
|
||||
public:
|
||||
KeyboardState(const std::string&, const Json::Value&);
|
||||
KeyboardState(const std::string&, const waybar::Bar&, const Json::Value&);
|
||||
~KeyboardState();
|
||||
auto update() -> void;
|
||||
|
||||
private:
|
||||
const Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
Gtk::Label numlock_label_;
|
||||
Gtk::Label capslock_label_;
|
||||
Gtk::Label scrolllock_label_;
|
||||
|
||||
std::string numlock_format_;
|
||||
std::string capslock_format_;
|
||||
std::string scrolllock_format_;
|
||||
const std::chrono::seconds interval_;
|
||||
std::string icon_locked_;
|
||||
std::string icon_unlocked_;
|
||||
|
||||
std::string dev_path_;
|
||||
int fd_;
|
||||
libevdev* dev_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user