feat(network): network info interval

This commit is contained in:
Alexis
2018-11-16 10:02:12 +01:00
parent c910767378
commit e42fae32ab
6 changed files with 30 additions and 11 deletions

View File

@ -34,7 +34,7 @@ class Battery : public ALabel {
std::string getState(uint16_t);
util::SleeperThread thread_;
util::SleeperThread threadTimer_;
util::SleeperThread thread_timer_;
std::vector<fs::path> batteries_;
int fd_;
std::string old_status_;

View File

@ -23,6 +23,7 @@ class Network : public ALabel {
static int netlinkResponse(int, void*, uint32_t, uint32_t groups = 0);
static int scanCb(struct nl_msg*, void*);
void worker();
void disconnected();
void initNL80211();
int getExternalInterface();
@ -33,10 +34,11 @@ class Network : public ALabel {
auto getInfo() -> void;
waybar::util::SleeperThread thread_;
waybar::util::SleeperThread thread_timer_;
int ifid_;
sa_family_t family_;
int sock_fd_;
struct sockaddr_nl nladdr_ = {};
struct sockaddr_nl nladdr_ = {0};
struct nl_sock* sk_ = nullptr;
int nl80211_id_;