mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #3 from marcplustwo/addbluetoothmodule
Add bluetooth module
This commit is contained in:
@ -32,6 +32,7 @@
|
||||
#include "bar.hpp"
|
||||
#include "modules/custom.hpp"
|
||||
#include "modules/temperature.hpp"
|
||||
#include "modules/bluetooth.hpp"
|
||||
|
||||
namespace waybar {
|
||||
|
||||
|
22
include/modules/bluetooth.hpp
Normal file
22
include/modules/bluetooth.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "ALabel.hpp"
|
||||
|
||||
#include <fmt/chrono.h>
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class Bluetooth : public ALabel {
|
||||
public:
|
||||
Bluetooth(const std::string&, const Json::Value&);
|
||||
~Bluetooth() = default;
|
||||
auto update() -> void;
|
||||
|
||||
private:
|
||||
std::string status_;
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
@ -9,7 +9,6 @@
|
||||
#include <netlink/genl/genl.h>
|
||||
#include <netlink/netlink.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <linux/rfkill.h>
|
||||
#include "ALabel.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
@ -46,7 +45,6 @@ class Network : public ALabel {
|
||||
const std::string getNetworkState() const;
|
||||
void clearIface();
|
||||
bool wildcardMatch(const std::string& pattern, const std::string& text) const;
|
||||
bool isDisabled(enum rfkill_type rfkill_type) const;
|
||||
|
||||
int ifid_;
|
||||
sa_family_t family_;
|
||||
|
9
include/util/rfkill.hpp
Normal file
9
include/util/rfkill.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <linux/rfkill.h>
|
||||
|
||||
namespace waybar::util::rfkill {
|
||||
|
||||
bool isDisabled(enum rfkill_type rfkill_type);
|
||||
|
||||
} // namespace waybar::util
|
Reference in New Issue
Block a user