Skip to content

Commit

Permalink
fix: allow any number of arguments to dwl:shcmd (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frewacom committed Dec 21, 2022
1 parent d0591ec commit 854aaaf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dscm-bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ dscm_binding_spawn(SCM args)
static inline SCM
dscm_binding_shcmd(SCM args)
{
SCM sh_args = scm_string_join(args, scm_from_utf8_string(" "),
scm_string_to_symbol(scm_from_utf8_string("infix")));
SCM extended = scm_list_3(scm_from_utf8_string("/bin/sh"),
scm_from_utf8_string("-c"), args);
scm_from_utf8_string("-c"),
sh_args);
return dscm_binding_spawn(extended);
}

Expand Down Expand Up @@ -400,7 +403,7 @@ dscm_register()
scm_c_define_gsubr("dwl:tag-monitor", 1, 0, 0, &dscm_binding_tagmon);
scm_c_define_gsubr("dwl:move-resize", 1, 0, 0, &dscm_binding_moveresize);
scm_c_define_gsubr("dwl:set-masters", 1, 0, 0, &dscm_binding_incnmaster);
scm_c_define_gsubr("dwl:shcmd", 1, 0, 0, &dscm_binding_shcmd);
scm_c_define_gsubr("dwl:shcmd", 0, 0, 1, &dscm_binding_shcmd);
scm_c_define_gsubr("dwl:change-alpha", 1, 0, 0, &dscm_binding_changealpha);
scm_c_define_gsubr("dwl:spawn-menu", 0, 0, 0, &dscm_binding_spawn_menu);
scm_c_define_gsubr("dwl:spawn-terminal", 0, 0, 0, &dscm_binding_spawn_terminal);
Expand Down

0 comments on commit 854aaaf

Please sign in to comment.