aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWynn Wolf Arbor2020-03-18 19:46:52 +0100
committerWolfgang Müller2021-04-27 12:28:35 +0200
commit26a8c6ced076b6a49b130deb4fe35d6707bebbae (patch)
tree171ed0f661c87273c629f413b64513f2e9d4e625
parenta0387a0fd66954e024c926655c866a3ab80e460f (diff)
downloadcwm-26a8c6ced076b6a49b130deb4fe35d6707bebbae.tar.gz
Remove ssh menu
There is no point in keeping this functionality. Saving a few key strokes is not worth the added complexity of the window manager parsing the known_hosts file.
-rw-r--r--calmwm.h2
-rw-r--r--conf.c4
-rw-r--r--cwm.19
-rw-r--r--cwmrc.54
-rw-r--r--kbfunc.c66
5 files changed, 0 insertions, 85 deletions
diff --git a/calmwm.h b/calmwm.h
index 030dfac..53f6cc7 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -321,7 +321,6 @@ struct conf {
int xrandr;
int xrandr_event_base;
char *conf_file;
- char *known_hosts;
char *wm_argv;
int debug;
};
@@ -527,7 +526,6 @@ void kbfunc_menu_cmd(void *, struct cargs *);
void kbfunc_menu_group(void *, struct cargs *);
void kbfunc_menu_wm(void *, struct cargs *);
void kbfunc_menu_exec(void *, struct cargs *);
-void kbfunc_menu_ssh(void *, struct cargs *);
void kbfunc_client_menu_label(void *, struct cargs *);
void kbfunc_exec_cmd(void *, struct cargs *);
void kbfunc_exec_lock(void *, struct cargs *);
diff --git a/conf.c b/conf.c
index 597dd79..633cc89 100644
--- a/conf.c
+++ b/conf.c
@@ -179,7 +179,6 @@ static const struct {
{ FUNC_SC(menu-cmd, menu_cmd, 0) },
{ FUNC_SC(menu-group, menu_group, 0) },
- { FUNC_SC(menu-ssh, menu_ssh, 0) },
{ FUNC_SC(menu-window, menu_client, CWM_MENU_WINDOW_ALL) },
{ FUNC_SC(menu-window-hidden, menu_client, CWM_MENU_WINDOW_HIDDEN) },
{ FUNC_SC(menu-exec, menu_exec, 0) },
@@ -211,7 +210,6 @@ static const struct {
{ "CM-Delete", "lock" },
{ "M-question", "menu-exec" },
{ "CM-w", "menu-exec-wm" },
- { "M-period", "menu-ssh" },
{ "M-Return", "window-hide" },
{ "M-Down", "window-lower" },
{ "M-Up", "window-raise" },
@@ -319,7 +317,6 @@ conf_init(struct conf *c)
home = "/";
}
xasprintf(&c->conf_file, "%s/%s", home, ".cwmrc");
- xasprintf(&c->known_hosts, "%s/%s", home, ".ssh/known_hosts");
}
void
@@ -366,7 +363,6 @@ conf_clear(struct conf *c)
free(c->color[i]);
free(c->conf_file);
- free(c->known_hosts);
free(c->font);
free(c->wmname);
}
diff --git a/cwm.1 b/cwm.1
index fc8f0ec..f452f3c 100644
--- a/cwm.1
+++ b/cwm.1
@@ -140,15 +140,6 @@ Resize window by a large amount; see
Spawn
.Dq exec program
dialog.
-.It Ic M-period
-Spawn
-.Dq ssh to
-dialog.
-This parses
-.Pa $HOME/.ssh/known_hosts
-to provide host auto-completion.
-.Xr ssh 1
-will be executed via the configured terminal emulator.
.It Ic CM-w
Spawn
.Dq exec WindowManager
diff --git a/cwmrc.5 b/cwmrc.5
index bca861b..46572b7 100644
--- a/cwmrc.5
+++ b/cwmrc.5
@@ -265,10 +265,6 @@ menu.
Launch
.Dq exec WindowManager
menu.
-.It menu-ssh
-Launch
-.Dq ssh
-menu.
.It group-toggle-[n]
Toggle visibility of group n, where n is 1-9.
.It group-only-[n]
diff --git a/kbfunc.c b/kbfunc.c
index 9e7118a..8af8436 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -684,72 +684,6 @@ out:
}
void
-kbfunc_menu_ssh(void *ctx, struct cargs *cargs)
-{
- struct screen_ctx *sc = ctx;
- struct cmd_ctx *cmd;
- struct menu *mi;
- struct menu_q menuq;
- FILE *fp;
- char *buf, *lbuf, *p;
- char hostbuf[HOST_NAME_MAX+1];
- char path[PATH_MAX];
- int l;
- size_t len;
- ssize_t slen;
- int mflags = (CWM_MENU_DUMMY);
-
- TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
- if (strcmp(cmd->name, "term") == 0)
- break;
- }
- TAILQ_INIT(&menuq);
-
- if ((fp = fopen(Conf.known_hosts, "r")) == NULL) {
- warn("%s: %s", __func__, Conf.known_hosts);
- goto menu;
- }
-
- lbuf = NULL;
- len = 0;
- while ((slen = getline(&lbuf, &len, fp)) != -1) {
- buf = lbuf;
- if (buf[slen - 1] == '\n')
- buf[slen - 1] = '\0';
-
- /* skip hashed hosts */
- if (strncmp(buf, HASH_MARKER, strlen(HASH_MARKER)) == 0)
- continue;
- for (p = buf; *p != ',' && *p != ' ' && p != buf + slen; p++)
- ;
- /* ignore badness */
- if (p - buf + 1 > sizeof(hostbuf))
- continue;
- (void)strlcpy(hostbuf, buf, p - buf + 1);
- menuq_add(&menuq, NULL, "%s", hostbuf);
- }
- free(lbuf);
- if (ferror(fp))
- err(1, "%s", path);
- (void)fclose(fp);
-menu:
- if ((mi = menu_filter(sc, &menuq, "ssh", NULL, mflags,
- search_match_text, search_print_text)) != NULL) {
- if (mi->text[0] == '\0')
- goto out;
- l = snprintf(path, sizeof(path), "%s -T '[ssh] %s' -e ssh %s",
- cmd->path, mi->text, mi->text);
- if (l == -1 || l >= sizeof(path))
- goto out;
- u_spawn(path);
- }
-out:
- if (mi != NULL && mi->dummy)
- free(mi);
- menuq_clear(&menuq);
-}
-
-void
kbfunc_client_menu_label(void *ctx, struct cargs *cargs)
{
struct client_ctx *cc = ctx;