Start GPS module

This commit is contained in:
Lena
2024-09-20 17:40:43 +02:00
parent c8484ebb1d
commit 45ebf45343
6 changed files with 191 additions and 1 deletions

31
include/modules/gps.hpp Normal file
View File

@ -0,0 +1,31 @@
#pragma once
#include <fmt/format.h>
#include <sys/statvfs.h>
#include <fstream>
#include <gps.h>
#include "ALabel.hpp"
#include "util/format.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
class Gps : public ALabel {
public:
Gps(const std::string&, const Json::Value&);
virtual ~Gps();
auto update() -> void override;
private:
const int getFixState() const;
const std::string getFixStateName() const;
const std::string getFixStateString() const;
util::SleeperThread thread_;
gps_data_t gps_data_;
std::string state_;
};
} // namespace waybar::modules