1
0
mirror of https://github.com/tiyn/dwmblocks.git synced 2025-11-01 19:51:19 +01:00

updated version to be based on utkarsh vermas dwmblocks

This commit is contained in:
2023-10-14 00:36:33 +02:00
parent 05b89ed6b5
commit ad879884b7
23 changed files with 484 additions and 290 deletions

15
inc/bar.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include "block.h"
#include "config.h"
#include "util.h"
typedef struct {
char *current;
char *previous;
} BarStatus;
extern unsigned short debugMode;
void initStatus(BarStatus *);
void freeStatus(BarStatus *);
void writeStatus(BarStatus *);

17
inc/block.h Normal file
View File

@@ -0,0 +1,17 @@
#pragma once
#include "config.h"
typedef struct {
const char *command;
const unsigned int interval;
const unsigned int signal;
int pipe[2];
char output[CMDLENGTH * 4 + 1];
} Block;
extern Block blocks[];
extern const unsigned short blockCount;
void execBlock(const Block *, const char *);
void execBlocks(unsigned int);
void updateBlock(Block *);

8
inc/util.h Normal file
View File

@@ -0,0 +1,8 @@
#pragma once
#define LEN(arr) (sizeof(arr) / sizeof(arr[0]))
#define MAX(a, b) (a > b ? a : b)
int gcd(int, int);
void closePipe(int[2]);
void trimUTF8(char*, unsigned int);

5
inc/x11.h Normal file
View File

@@ -0,0 +1,5 @@
#pragma once
int setupX();
int closeX();
void setXRootName(char *);