polybar-dwm/include/modules/script.hpp

41 lines
802 B
C++
Raw Normal View History

#pragma once
2016-05-19 16:41:06 +02:00
#include "adapters/script_runner.hpp"
#include "modules/meta/base.hpp"
2016-06-15 05:32:35 +02:00
#include "utils/command.hpp"
#include "utils/io.hpp"
2016-05-19 16:41:06 +02:00
2016-11-19 06:22:44 +01:00
POLYBAR_NS
2016-06-15 05:32:35 +02:00
namespace modules {
class script_module : public module<script_module> {
2016-06-15 05:32:35 +02:00
public:
explicit script_module(const bar_settings&, string);
void start() override;
void stop() override;
2016-06-15 05:32:35 +02:00
2016-11-02 20:22:45 +01:00
string get_output();
2016-11-25 13:55:15 +01:00
bool build(builder* builder, const string& tag) const;
2016-06-15 05:32:35 +02:00
static constexpr auto TYPE = "custom/script";
2016-06-15 05:32:35 +02:00
protected:
bool check_condition();
private:
static constexpr const char* TAG_LABEL{"<label>"};
2016-06-15 05:32:35 +02:00
const bool m_tail;
const script_runner::interval m_interval{0};
script_runner m_runner;
2016-06-15 05:32:35 +02:00
map<mousebtn, string> m_actions;
label_t m_label;
2016-05-19 16:41:06 +02:00
};
} // namespace modules
2016-06-15 05:32:35 +02:00
2016-11-19 06:22:44 +01:00
POLYBAR_NS_END