~kris/suckless

dwmblocks

ref: 40bc40b1a0cc1044fca8c3b2cfbdc8a487d1c6fd dwmblocks/include/block.h -rw-r--r-- 720 bytes
40bc40b1 — Kris Yotam Switch to dwmblocks-async for better performance 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef BLOCK_H
#define BLOCK_H

#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>

#include "config.h"
#include "util.h"

typedef struct {
    const char *const icon;
    const char *const command;
    const unsigned int interval;
    const int signal;

    int pipe[PIPE_FD_COUNT];
    char output[MAX_BLOCK_OUTPUT_LENGTH * UTF8_MAX_BYTE_COUNT + 1];
    pid_t fork_pid;
} block;

block block_new(const char *const icon, const char *const command,
                const unsigned int interval, const int signal);
int block_init(block *const block);
int block_deinit(block *const block);
int block_execute(block *const block, const uint8_t button);
int block_update(block *const block);

#endif  // BLOCK_H