File: gps.hpp

package info (click to toggle)
waybar 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,464 kB
  • sloc: cpp: 25,331; xml: 742; python: 146; ansic: 77; makefile: 29
file content (40 lines) | stat: -rw-r--r-- 745 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include <fmt/format.h>
#include <sys/statvfs.h>

#ifdef WANT_RFKILL
#include "util/rfkill.hpp"
#endif

#include <gps.h>

#include "ALabel.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:
#ifdef WANT_RFKILL
  util::Rfkill rfkill_;
#endif
  const std::string getFixModeName() const;
  const std::string getFixModeString() const;

  const std::string getFixStatusString() const;

  util::SleeperThread thread_, gps_thread_;
  gps_data_t gps_data_;
  std::string state_;

  bool hideDisconnected = true;
  bool hideNoFix = false;
};

}  // namespace waybar::modules