few changes to ipc

This commit is contained in:
speedie 2022-11-30 17:37:20 +01:00
parent 9659c70539
commit 97e719dea0
2 changed files with 14 additions and 15 deletions

27
ipc.h
View file

@ -3,22 +3,21 @@
*
* If you are going to use IPC you must follow the points below:
*
* - If you use an operating system that isn't GNU/Linux, edit config.mk and comment out the three lines, then edit toggle.h and set USEIPC to 0.
* - If you use an operating system that isn't GNU/Linux, edit config.mk and comment out the three lines, then edit toggle.h and set USEIPC to 0. IPC support is not available for non-GNU/Linux operating systems.
* - Install the 'yajl' package using your distro's package manager. It will depend on your distribution but on Gentoo the package is named 'yajl'.
* - Set USEIPC to 1 in toggle.h.
*/
static char *ipcsockpath = "/tmp/speedwm.sock";
static char *ipcsockpath = "/tmp/speedwm.sock";
static IPCCommand ipccommands[] = {
IPCCOMMAND(view, 1, { ARG_TYPE_UINT } ),
IPCCOMMAND(tagmon, 1, { ARG_TYPE_UINT } ),
IPCCOMMAND(focusmon, 1, { ARG_TYPE_SINT } ),
IPCCOMMAND(focusstackvis, 1, { ARG_TYPE_SINT } ),
IPCCOMMAND(zoom, 1, { ARG_TYPE_NONE } ),
IPCCOMMAND(incmastercount, 1, { ARG_TYPE_SINT } ),
IPCCOMMAND(killclient, 1, { ARG_TYPE_SINT } ),
IPCCOMMAND(togglefloating, 1, { ARG_TYPE_NONE } ),
IPCCOMMAND(setmfact, 1, { ARG_TYPE_FLOAT } ),
IPCCOMMAND(setlayoutsafe, 1, { ARG_TYPE_PTR } ),
IPCCOMMAND(quit, 1, { ARG_TYPE_NONE } )
ipccmd( view, 1, { ARG_TYPE_UINT } ),
ipccmd( tagmon, 1, { ARG_TYPE_UINT } ),
ipccmd( focusmon, 1, { ARG_TYPE_SINT } ),
ipccmd( focusstackvis, 1, { ARG_TYPE_SINT } ),
ipccmd( zoom, 1, { ARG_TYPE_NONE } ),
ipccmd( incmastercount, 1, { ARG_TYPE_SINT } ),
ipccmd( killclient, 1, { ARG_TYPE_SINT } ),
ipccmd( togglefloating, 1, { ARG_TYPE_NONE } ),
ipccmd( setmfact, 1, { ARG_TYPE_FLOAT } ),
ipccmd( setlayoutsafe, 1, { ARG_TYPE_PTR } ),
ipccmd( quit, 1, { ARG_TYPE_NONE } )
};

View file

@ -12,7 +12,7 @@
#define IPC_MAGIC_ARR { 'S', 'P', 'E', 'E', 'D', 'W', 'M', '-', 'I', 'P', 'C'}
#define IPC_MAGIC_LEN 11 // Not including null char
#define IPCCOMMAND(FUNC, ARGC, TYPES) \
#define ipccmd(FUNC, ARGC, TYPES) \
{ #FUNC, {FUNC }, ARGC, (ArgType[ARGC])TYPES }
// clang-format on