2016-05-30 23:58:58 -04:00
|
|
|
#pragma once
|
2016-05-19 10:41:06 -04:00
|
|
|
|
|
|
|
#include "modules/base.hpp"
|
|
|
|
#include "services/command.hpp"
|
|
|
|
|
|
|
|
namespace modules
|
|
|
|
{
|
|
|
|
DefineModule(ScriptModule, TimerModule)
|
|
|
|
{
|
2016-05-30 23:58:58 -04:00
|
|
|
static constexpr auto TAG_OUTPUT = "<output>";
|
2016-05-19 10:41:06 -04:00
|
|
|
|
|
|
|
std::unique_ptr<Builder> builder;
|
2016-06-14 06:14:29 -04:00
|
|
|
std::unique_ptr<Command> command;
|
2016-05-19 10:41:06 -04:00
|
|
|
|
|
|
|
std::string exec;
|
2016-06-13 17:41:59 -04:00
|
|
|
bool tail = false;
|
|
|
|
|
2016-05-19 10:41:06 -04:00
|
|
|
std::string click_left;
|
|
|
|
std::string click_middle;
|
|
|
|
std::string click_right;
|
|
|
|
std::string scroll_up;
|
|
|
|
std::string scroll_down;
|
|
|
|
|
|
|
|
std::string output;
|
|
|
|
std::atomic<int> counter;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
public:
|
2016-06-20 21:59:43 -04:00
|
|
|
explicit ScriptModule(std::string name);
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2016-06-14 06:14:29 -04:00
|
|
|
void start();
|
2016-05-19 10:41:06 -04:00
|
|
|
bool update();
|
2016-06-20 21:59:43 -04:00
|
|
|
bool build(Builder *builder, std::string tag);
|
2016-05-19 10:41:06 -04:00
|
|
|
std::string get_output();
|
|
|
|
};
|
|
|
|
}
|