#pragma once

#include <fmt/format.h>
#include <libmm-glib/libmm-glib.h>
#include <sys/statvfs.h>

#include <fstream>

#include "ALabel.hpp"
#include "util/format.hpp"
#include "util/sleeper_thread.hpp"

namespace waybar::modules {

class Wwan : public ALabel {
 public:
  Wwan(const std::string&, const Json::Value&);
  virtual ~Wwan();
  auto update() -> void override;

 private:
  void updateCurrentModem();

  util::SleeperThread thread_;
  std::string state_;
  GDBusConnection* connection = nullptr;
  MMManager* manager = nullptr;
  MMModem* current_modem = nullptr;

  bool hideDisconnected = true;

  const std::string dbus_name = "org.freedesktop.ModemManager1";
  const std::string dbus_obj_path = "/org/freedesktop/ModemManager1/";
  const std::string dbus_modems_path = "/org/freedesktop/ModemManager1/Modems/";
};

}  // namespace waybar::modules
