mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-22 18:25:38 +02:00
module: add new function module_signal_ready()
This commit is contained in:
parent
a3eb7ebc08
commit
3413232ed6
9 changed files with 19 additions and 14 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
@ -203,7 +202,7 @@ run(struct module_run_context *ctx)
|
|||
udev_monitor_filter_add_match_subsystem_devtype(mon, "power_supply", NULL);
|
||||
udev_monitor_enable_receiving(mon);
|
||||
|
||||
write(ctx->ready_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||
module_signal_ready(ctx);
|
||||
|
||||
bool first = true;
|
||||
while (true) {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "clock.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <poll.h>
|
||||
|
@ -52,7 +50,7 @@ run(struct module_run_context *ctx)
|
|||
{
|
||||
const struct bar *bar = ctx->module->bar;
|
||||
|
||||
write(ctx->ready_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||
module_signal_ready(ctx);
|
||||
|
||||
while (true) {
|
||||
time_t now = time(NULL);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
@ -287,7 +286,7 @@ run(struct module_run_context *ctx)
|
|||
send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
|
||||
send_pkg(sock, I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[\"workspace\"]");
|
||||
|
||||
write(ctx->ready_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||
module_signal_ready(ctx);
|
||||
|
||||
char buf[1 * 1024 * 1024]; /* Some replies are *big*. TODO: grow dynamically */
|
||||
size_t buf_idx = 0;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "label.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <poll.h>
|
||||
|
@ -30,7 +28,7 @@ content(struct module *mod)
|
|||
static int
|
||||
run(struct module_run_context *ctx)
|
||||
{
|
||||
write(ctx->ready_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||
module_signal_ready(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -439,7 +438,7 @@ run(struct module_run_context *ctx)
|
|||
}
|
||||
|
||||
/* TODO: move this to later */
|
||||
write(ctx->ready_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||
module_signal_ready(ctx);
|
||||
|
||||
int ret = talk_to_xkb(ctx->abort_fd, ctx->module->bar, ctx->module->private, conn)
|
||||
? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
|
|
@ -207,7 +207,7 @@ run(struct module_run_context *ctx)
|
|||
update_title(m);
|
||||
mod->bar->refresh(mod->bar);
|
||||
|
||||
write(ctx->ready_fd, &(uint64_t){1}, sizeof(uint64_t));
|
||||
module_signal_ready(ctx);
|
||||
|
||||
int xcb_fd = xcb_get_file_descriptor(m->conn);
|
||||
while (true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue