4a230d362a
This patch currently supports the following requests: * Run custom commands with arguments (similar to key bind functions) * Get monitor properties * Get all available layouts * Get available tags * Get client properties * Subscribe to tag change, client focus change, and layout change, monitor focus change, focused title change, and client state change events This patch includes a dwm-msg cli program that supports all of the above requests for easy integration into shell scripts. The messages are sent in a JSON format to promote integration to increase scriptability in languages like Python/JavaScript. The patch requires YAJL for JSON parsing and a system with epoll support. Portability is planned to be increased in the future. This patch is best applied after all other patches to avoid merge conflicts. For more info on the IPC implementation and how to send/receive messages, documentation can be found at https://github.com/mihirlad55/dwm-ipc
19 lines
574 B
C
19 lines
574 B
C
/* See LICENSE file for copyright and license details. */
|
|
|
|
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
|
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
|
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
|
|
|
|
#ifdef _DEBUG
|
|
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
|
|
#else
|
|
#define DEBUG(...)
|
|
#endif
|
|
|
|
void die(const char *fmt, ...);
|
|
void *ecalloc(size_t nmemb, size_t size);
|
|
int normalizepath(const char *path, char **normal);
|
|
int mkdirp(const char *path);
|
|
int parentdir(const char *path, char **parent);
|
|
int nullterminate(char **str, size_t *len);
|