From 3c5b2b61a6475f62b421ccb02990db6bddb30ff5 Mon Sep 17 00:00:00 2001
From: Patrick Ziegler
Date: Sat, 30 Oct 2021 21:00:52 +0200
Subject: [PATCH] ipc: Move running initial hook to update function (#2547)
---
include/modules/ipc.hpp | 13 ++++--
src/modules/ipc.cpp | 90 ++++++++++++++++++++++++++---------------
2 files changed, 68 insertions(+), 35 deletions(-)
diff --git a/include/modules/ipc.hpp b/include/modules/ipc.hpp
index 977847c8..b59f17c4 100644
--- a/include/modules/ipc.hpp
+++ b/include/modules/ipc.hpp
@@ -27,7 +27,7 @@ namespace modules {
explicit ipc_module(const bar_settings&, string);
void start() override;
- void update() {}
+ void update();
string get_output();
bool build(builder* builder, const string& tag) const;
void on_message(const string& message);
@@ -47,13 +47,20 @@ namespace modules {
void action_prev();
void action_reset();
+ void hook_offset(int offset);
+
+ bool has_initial() const;
+ bool has_hook() const;
+
+ void set_hook(int h);
+
private:
static constexpr const char* TAG_OUTPUT{"