From fcbb22d90dc551003f72cb5918c4ece1a24eb69e Mon Sep 17 00:00:00 2001 From: LBCrion <76477076+LBCrion@users.noreply.github.com> Date: Sun, 4 Aug 2024 10:06:02 +0200 Subject: [PATCH] actionlib: check if sway ipc is active before executing sway specific actions --- src/actionlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/actionlib.c b/src/actionlib.c index a82d3f4..2a98506 100644 --- a/src/actionlib.c +++ b/src/actionlib.c @@ -96,7 +96,8 @@ static ModuleActionHandlerV1 menu_handler = { static void swaycmd_action ( gchar *cmd, gchar *name, void *widget, void *event, window_t *win, guint16 *state ) { - sway_ipc_command("%s",cmd); + if(ipc_get()==IPC_SWAY) + sway_ipc_command("%s",cmd); } static ModuleActionHandlerV1 swaycmd_handler = { @@ -107,7 +108,7 @@ static ModuleActionHandlerV1 swaycmd_handler = { static void swaywincmd_action ( gchar *cmd, gchar *name, void *widget, void *event, window_t *win, guint16 *state ) { - if(win) + if(win && ipc_get()==IPC_SWAY) sway_ipc_command("[con_id=%ld] %s",GPOINTER_TO_INT(win->uid), cmd); }