Skip to content

Commit

Permalink
actionlib: check if sway ipc is active before executing sway specific…
Browse files Browse the repository at this point in the history
… actions
  • Loading branch information
LBCrion committed Aug 4, 2024
1 parent a731dbb commit fcbb22d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/actionlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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);
}

Expand Down

0 comments on commit fcbb22d

Please sign in to comment.