Remove never used systray module
Not the same as the new tray module
This commit is contained in:
parent
b0e33053f9
commit
31bdacb3d7
@ -16,9 +16,6 @@
|
|||||||
#include "modules/menu.hpp"
|
#include "modules/menu.hpp"
|
||||||
#include "modules/meta/base.hpp"
|
#include "modules/meta/base.hpp"
|
||||||
#include "modules/script.hpp"
|
#include "modules/script.hpp"
|
||||||
#if DEBUG
|
|
||||||
#include "modules/systray.hpp"
|
|
||||||
#endif
|
|
||||||
#include "modules/temperature.hpp"
|
#include "modules/temperature.hpp"
|
||||||
#include "modules/text.hpp"
|
#include "modules/text.hpp"
|
||||||
#include "modules/tray.hpp"
|
#include "modules/tray.hpp"
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
#if DEBUG
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "modules/meta/static_module.hpp"
|
|
||||||
|
|
||||||
POLYBAR_NS
|
|
||||||
|
|
||||||
class connection;
|
|
||||||
|
|
||||||
namespace modules {
|
|
||||||
/**
|
|
||||||
* Module used to display information about the
|
|
||||||
* currently active X window.
|
|
||||||
*/
|
|
||||||
class systray_module : public static_module<systray_module> {
|
|
||||||
public:
|
|
||||||
explicit systray_module(const bar_settings&, string);
|
|
||||||
|
|
||||||
void update();
|
|
||||||
bool build(builder* builder, const string& tag) const;
|
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/systray";
|
|
||||||
|
|
||||||
static constexpr auto EVENT_TOGGLE = "toggle";
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void action_toggle();
|
|
||||||
|
|
||||||
private:
|
|
||||||
static constexpr const char* TAG_LABEL_TOGGLE{"<label-toggle>"};
|
|
||||||
static constexpr const char* TAG_TRAY_CLIENTS{"<tray-clients>"};
|
|
||||||
|
|
||||||
connection& m_connection;
|
|
||||||
label_t m_label;
|
|
||||||
|
|
||||||
bool m_hidden{false};
|
|
||||||
};
|
|
||||||
} // namespace modules
|
|
||||||
|
|
||||||
POLYBAR_NS_END
|
|
||||||
#endif
|
|
@ -26,8 +26,6 @@
|
|||||||
#define TRAY_WM_NAME "Polybar tray window"
|
#define TRAY_WM_NAME "Polybar tray window"
|
||||||
#define TRAY_WM_CLASS "tray\0Polybar"
|
#define TRAY_WM_CLASS "tray\0Polybar"
|
||||||
|
|
||||||
#define TRAY_PLACEHOLDER "<placeholder-systray>"
|
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
namespace chrono = std::chrono;
|
namespace chrono = std::chrono;
|
||||||
|
@ -96,7 +96,6 @@ set(POLY_SOURCES
|
|||||||
${src_dir}/modules/meta/base.cpp
|
${src_dir}/modules/meta/base.cpp
|
||||||
${src_dir}/modules/meta/factory.cpp
|
${src_dir}/modules/meta/factory.cpp
|
||||||
${src_dir}/modules/script.cpp
|
${src_dir}/modules/script.cpp
|
||||||
${src_dir}/modules/systray.cpp
|
|
||||||
${src_dir}/modules/temperature.cpp
|
${src_dir}/modules/temperature.cpp
|
||||||
${src_dir}/modules/text.cpp
|
${src_dir}/modules/text.cpp
|
||||||
${src_dir}/modules/xbacklight.cpp
|
${src_dir}/modules/xbacklight.cpp
|
||||||
|
@ -54,9 +54,6 @@ namespace modules {
|
|||||||
map_entry<alsa_module>(),
|
map_entry<alsa_module>(),
|
||||||
map_entry<pulseaudio_module>(),
|
map_entry<pulseaudio_module>(),
|
||||||
map_entry<network_module>(),
|
map_entry<network_module>(),
|
||||||
#if DEBUG
|
|
||||||
map_entry<systray_module>(),
|
|
||||||
#endif
|
|
||||||
map_entry<temperature_module>(),
|
map_entry<temperature_module>(),
|
||||||
map_entry<xbacklight_module>(),
|
map_entry<xbacklight_module>(),
|
||||||
map_entry<xkeyboard_module>(),
|
map_entry<xkeyboard_module>(),
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
#if DEBUG
|
|
||||||
#include "modules/systray.hpp"
|
|
||||||
|
|
||||||
#include "drawtypes/label.hpp"
|
|
||||||
#include "modules/meta/base.inl"
|
|
||||||
#include "x11/connection.hpp"
|
|
||||||
#include "x11/tray_manager.hpp"
|
|
||||||
|
|
||||||
POLYBAR_NS
|
|
||||||
|
|
||||||
namespace modules {
|
|
||||||
template class module<systray_module>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct module
|
|
||||||
*/
|
|
||||||
systray_module::systray_module(const bar_settings& bar, string name_)
|
|
||||||
: static_module<systray_module>(bar, move(name_)), m_connection(connection::make()) {
|
|
||||||
m_router->register_action(EVENT_TOGGLE, [this]() { action_toggle(); });
|
|
||||||
|
|
||||||
// Add formats and elements
|
|
||||||
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL_TOGGLE, {TAG_LABEL_TOGGLE, TAG_TRAY_CLIENTS});
|
|
||||||
|
|
||||||
if (m_formatter->has(TAG_LABEL_TOGGLE)) {
|
|
||||||
m_label = load_label(m_conf, name(), TAG_LABEL_TOGGLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update
|
|
||||||
*/
|
|
||||||
void systray_module::update() {
|
|
||||||
if (m_label) {
|
|
||||||
m_label->reset_tokens();
|
|
||||||
m_label->replace_token("%title%", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
broadcast();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build output
|
|
||||||
*/
|
|
||||||
bool systray_module::build(builder* builder, const string& tag) const {
|
|
||||||
if (tag == TAG_LABEL_TOGGLE) {
|
|
||||||
builder->action(mousebtn::LEFT, *this, EVENT_TOGGLE, "", m_label);
|
|
||||||
} else if (tag == TAG_TRAY_CLIENTS && !m_hidden) {
|
|
||||||
builder->node(TRAY_PLACEHOLDER);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle input event
|
|
||||||
*/
|
|
||||||
void systray_module::action_toggle() {
|
|
||||||
m_hidden = !m_hidden;
|
|
||||||
broadcast();
|
|
||||||
}
|
|
||||||
} // namespace modules
|
|
||||||
|
|
||||||
POLYBAR_NS_END
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user