Files
Waybar/include/modules/systemd_failed_units.hpp
T

35 lines
836 B
C++
Raw Normal View History

2024-01-09 18:05:17 +08:00
#pragma once
#include <giomm/dbusproxy.h>
2024-01-30 09:07:37 +01:00
#include <string>
2024-01-09 18:05:17 +08:00
#include "ALabel.hpp"
namespace waybar::modules {
class SystemdFailedUnits : public ALabel {
public:
2026-02-04 09:24:14 +01:00
SystemdFailedUnits(const std::string&, const Json::Value&);
2024-01-09 18:05:17 +08:00
virtual ~SystemdFailedUnits();
auto update() -> void override;
private:
bool hide_on_ok;
std::string format_ok;
bool update_pending;
std::string system_state, user_state, overall_state;
uint32_t nr_failed_system, nr_failed_user, nr_failed;
2024-02-12 20:09:22 +01:00
std::string last_status;
2024-01-09 18:05:17 +08:00
Glib::RefPtr<Gio::DBus::Proxy> system_proxy, user_proxy;
2026-02-04 09:24:14 +01:00
void notify_cb(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
const Glib::VariantContainerBase& arguments);
void RequestFailedUnits();
void RequestSystemState();
2024-01-09 18:05:17 +08:00
void updateData();
};
} // namespace waybar::modules