diff options
author | okan | 2014-09-06 16:14:35 +0000 |
---|---|---|
committer | okan | 2014-09-06 16:14:35 +0000 |
commit | 09c6df182c5227f2f6c12debe93eefeb2d0d8ce3 (patch) | |
tree | 1153673712afe539b26083a6a657d0e948791b0d /kbfunc.c | |
parent | e829ebdfb7b6c439829f9be1473e94d9e0724294 (diff) | |
download | cwm-09c6df182c5227f2f6c12debe93eefeb2d0d8ce3.tar.gz |
Move termpath and lockpath into cmdq; side effect is that 'lock' and
'term' now show up in the application menu.
Diffstat (limited to 'kbfunc.c')
-rw-r--r-- | kbfunc.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.97 2014/09/01 18:17:32 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.98 2014/09/06 16:14:35 okan Exp $ */ #include <sys/param.h> @@ -213,13 +213,21 @@ kbfunc_cmdexec(struct client_ctx *cc, union arg *arg) void kbfunc_term(struct client_ctx *cc, union arg *arg) { - u_spawn(Conf.termpath); + struct cmd *cmd; + + TAILQ_FOREACH(cmd, &Conf.cmdq, entry) + if (strcmp(cmd->name, "term") == 0) + u_spawn(cmd->path); } void kbfunc_lock(struct client_ctx *cc, union arg *arg) { - u_spawn(Conf.lockpath); + struct cmd *cmd; + + TAILQ_FOREACH(cmd, &Conf.cmdq, entry) + if (strcmp(cmd->name, "lock") == 0) + u_spawn(cmd->path); } void @@ -309,6 +317,7 @@ void kbfunc_ssh(struct client_ctx *cc, union arg *arg) { struct screen_ctx *sc = cc->sc; + struct cmd *cmdq; struct menu *mi; struct menu_q menuq; FILE *fp; @@ -323,6 +332,10 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg) return; } + TAILQ_FOREACH(cmdq, &Conf.cmdq, entry) + if (strcmp(cmdq->name, "term") == 0) + break; + TAILQ_INIT(&menuq); lbuf = NULL; @@ -356,7 +369,7 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg) if (mi->text[0] == '\0') goto out; l = snprintf(cmd, sizeof(cmd), "%s -T '[ssh] %s' -e ssh %s", - Conf.termpath, mi->text, mi->text); + cmdq->path, mi->text, mi->text); if (l != -1 && l < sizeof(cmd)) u_spawn(cmd); } |