Rewrite the entire code-base

The following changes are focused upon:
- Modularity
- Doing away with globals
- No heap allocations
- Better command line interface
- Switch from Xlib to XCB
- More verbose type definitions
- Implement a single-file config by utilising X-macros
This commit is contained in:
Utkarsh Verma
2023-10-24 08:44:31 +05:30
parent 2773129533
commit bc84d094cd
30 changed files with 918 additions and 396 deletions

View File

@@ -1,6 +1,29 @@
#pragma once
#define CLICKABLE_BLOCKS 1 // Enable clickability for blocks
#define CMDLENGTH 45 // Trim block output to this length
#define DELIMITER " " // Delimiter string used to separate blocks
#define LEADING_DELIMITER 0 // Whether a leading separator should be used
// String used to delimit block outputs in the status.
#define DELIMITER " "
// Maximum number of Unicode characters that a block can output.
#define MAX_BLOCK_OUTPUT_LENGTH 45
// Control whether blocks are clickable.
#define CLICKABLE_BLOCKS 1
// Control whether a leading delimiter should be prepended to the status.
#define LEADING_DELIMITER 0
// Control whether a trailing delimiter should be appended to the status.
#define TRAILING_DELIMITER 0
// Define blocks for the status feed as X(cmd, interval, signal).
#define BLOCKS(X) \
X("sb-mail", 600, 1) \
X("sb-music", 0, 2) \
X("sb-disk", 1800, 3) \
X("sb-memory", 10, 4) \
X("sb-loadavg", 5, 5) \
X("sb-mic", 0, 6) \
X("sb-record", 0, 7) \
X("sb-volume", 0, 8) \
X("sb-battery", 5, 9) \
X("sb-date", 1, 10)