Files

41 lines
745 B
C++
Raw Permalink Normal View History

2024-09-20 17:40:43 +02:00
#pragma once
#include <fmt/format.h>
#include <sys/statvfs.h>
2024-11-09 11:58:08 +01:00
#ifdef WANT_RFKILL
#include "util/rfkill.hpp"
#endif
2024-09-20 17:40:43 +02:00
#include <gps.h>
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
2025-06-22 10:01:36 +02:00
class Gps : public ALabel {
public:
Gps(const std::string&, const Json::Value&);
virtual ~Gps();
auto update() -> void override;
2024-09-20 17:40:43 +02:00
2025-06-22 10:01:36 +02:00
private:
#ifdef WANT_RFKILL
util::Rfkill rfkill_;
#endif
const std::string getFixModeName() const;
const std::string getFixModeString() const;
2024-09-20 19:05:26 +02:00
2025-06-22 10:01:36 +02:00
const std::string getFixStatusString() const;
2024-09-20 17:40:43 +02:00
2025-06-22 10:01:36 +02:00
util::SleeperThread thread_, gps_thread_;
gps_data_t gps_data_;
std::string state_;
2024-09-20 19:56:16 +02:00
2025-06-22 10:01:36 +02:00
bool hideDisconnected = true;
bool hideNoFix = false;
};
2024-09-20 17:40:43 +02:00
} // namespace waybar::modules