mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #1661 from asas1asas200/zeng-feat-improve_keyboard
This commit is contained in:
@ -3,12 +3,15 @@
|
||||
#include <fmt/chrono.h>
|
||||
#include <gtkmm/label.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <libevdev/libevdev.h>
|
||||
#include <libinput.h>
|
||||
}
|
||||
|
||||
namespace waybar::modules {
|
||||
@ -20,6 +23,8 @@ class KeyboardState : public AModule {
|
||||
auto update() -> void;
|
||||
|
||||
private:
|
||||
auto tryAddDevice(const std::string&) -> void;
|
||||
|
||||
Gtk::Box box_;
|
||||
Gtk::Label numlock_label_;
|
||||
Gtk::Label capslock_label_;
|
||||
@ -31,11 +36,12 @@ class KeyboardState : public AModule {
|
||||
const std::chrono::seconds interval_;
|
||||
std::string icon_locked_;
|
||||
std::string icon_unlocked_;
|
||||
std::string devices_path_;
|
||||
|
||||
int fd_;
|
||||
libevdev* dev_;
|
||||
struct libinput* libinput_;
|
||||
std::unordered_map<std::string, struct libinput_device*> libinput_devices_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
util::SleeperThread libinput_thread_, hotplug_thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
Reference in New Issue
Block a user