Merge pull request #4265 from g-goessel/master

feat: Add wifi network link bitrate value
This commit is contained in:
Alexis Rouillard
2026-07-04 01:09:20 +02:00
committed by GitHub
3 changed files with 107 additions and 1 deletions
+6
View File
@@ -17,6 +17,8 @@
#include "util/rfkill.hpp"
#endif
#define ETH_ALEN 6
enum ip_addr_pref : uint8_t { IPV4, IPV6, IPV4_6 };
namespace waybar::modules {
@@ -34,6 +36,7 @@ class Network : public ALabel {
static int handleEvents(struct nl_msg*, void*);
static int handleEventsDone(struct nl_msg*, void*);
static int handleScan(struct nl_msg*, void*);
static int handleStationGet(struct nl_msg *msg, void *data);
void askForStateDump(void);
@@ -57,6 +60,7 @@ class Network : public ALabel {
struct sockaddr_nl nladdr_{0};
struct nl_sock* sock_{nullptr};
struct nl_sock* ev_sock_{nullptr};
struct nl_sock* station_sock_{nullptr};
int efd_{-1};
int ev_fd_{-1};
int nl80211_id_{-1};
@@ -97,6 +101,8 @@ class Network : public ALabel {
util::Rfkill rfkill_{RFKILL_TYPE_WLAN};
#endif
float frequency_{0};
uint32_t tx_bitrate_{0};
uint32_t rx_bitrate_{0};
};
} // namespace waybar::modules