File: systemd_failed_units.hpp

package info (click to toggle)
waybar 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,364 kB
  • sloc: cpp: 24,698; xml: 742; python: 146; ansic: 77; makefile: 26
file content (34 lines) | stat: -rw-r--r-- 838 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
#pragma once

#include <giomm/dbusproxy.h>

#include <string>

#include "ALabel.hpp"

namespace waybar::modules {

class SystemdFailedUnits : public ALabel {
 public:
  SystemdFailedUnits(const std::string &, const Json::Value &);
  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;
  std::string last_status;
  Glib::RefPtr<Gio::DBus::Proxy> system_proxy, user_proxy;

  void notify_cb(const Glib::ustring &sender_name, const Glib::ustring &signal_name,
                 const Glib::VariantContainerBase &arguments);
  void RequestFailedUnits();
  void RequestSystemState();
  void updateData();
};

}  // namespace waybar::modules