File: tray.hpp

package info (click to toggle)
polybar 3.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,108 kB
  • sloc: cpp: 30,424; python: 3,750; sh: 284; makefile: 83
file content (39 lines) | stat: -rw-r--r-- 945 bytes parent folder | download | duplicates (2)
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
#pragma once

#include "common.hpp"
#include "components/bar.hpp"
#include "modules/meta/static_module.hpp"
#include "modules/meta/types.hpp"
#include "x11/tray_manager.hpp"

POLYBAR_NS
namespace modules {
/**
 * Wraps the tray_manager in a module.
 *
 * The module produces the `%{Pt}` formatting tag, which is used by the renderer
 * to place the tray.
 * The visibility of the tray icons is directly tied to the visibility of the
 * module.
 */
class tray_module : public static_module<tray_module> {
 public:
  explicit tray_module(const bar_settings& bar_settings, string name_, const config&);
  string get_format() const;

  void set_visible(bool value) override;

  void start() override;

  bool build(builder* builder, const string& tag) const;
  void update() {}

  static constexpr auto TYPE = TRAY_TYPE;

 private:
  static constexpr const char* TAG_TRAY{"<tray>"};

  tray::manager m_tray;
};
} // namespace modules
POLYBAR_NS_END