From 5944989a8aab120ea695193b63c5affb8691c868 Mon Sep 17 00:00:00 2001 From: asas1asas200 Date: Wed, 24 Aug 2022 02:41:12 +0800 Subject: [PATCH] doc(keyboard): add deprecated warning --- man/waybar-keyboard-state.5.scd | 1 + src/modules/keyboard_state.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/man/waybar-keyboard-state.5.scd b/man/waybar-keyboard-state.5.scd index 905a321..fef4670 100644 --- a/man/waybar-keyboard-state.5.scd +++ b/man/waybar-keyboard-state.5.scd @@ -13,6 +13,7 @@ You must be a member of the input group to use this module. # CONFIGURATION *interval*: ++ + Deprecated, this module use event loop now, the interval has no effect. typeof: integer ++ default: 1 ++ The interval, in seconds, to poll the keyboard state. diff --git a/src/modules/keyboard_state.cpp b/src/modules/keyboard_state.cpp index 40e8d93..f3e846d 100644 --- a/src/modules/keyboard_state.cpp +++ b/src/modules/keyboard_state.cpp @@ -110,6 +110,10 @@ waybar::modules::KeyboardState::KeyboardState(const std::string& id, const Bar& static struct libinput_interface interface = { [](const char* path, int flags, void* user_data) { return open(path, flags); }, [](int fd, void* user_data) { close(fd); }}; + if (config_["interval"].isUInt()) { + spdlog::warn("keyboard-state: interval is deprecated"); + } + libinput_ = libinput_path_create_context(&interface, NULL); box_.set_name("keyboard-state");