summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2014-09-06 16:14:35 +0000
committerokan <okan>2014-09-06 16:14:35 +0000
commit5cd4cce3a02203aaf1e85ffbe7155a782161ff5c (patch)
tree611a19a4460cb66eb1cc89c3d4b6008d3b19d1e3 /kbfunc.c
parent142f52a0aab29681a46e4ce10eb2618ee99ede95 (diff)
downloadcwm-5cd4cce3a02203aaf1e85ffbe7155a782161ff5c.tar.gz
cwm-5cd4cce3a02203aaf1e85ffbe7155a782161ff5c.tar.xz
cwm-5cd4cce3a02203aaf1e85ffbe7155a782161ff5c.zip
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.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 4cc0dc1..dff75dc 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -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);
 	}