Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

dwm arch linux. How to make key bindings to run Terminal programs

So i was using i3. Now i want to see dwm. Made keybidings to run firefox on Modkey+w. It works well, but now when i want to do simmilar commands for nvim, ranger, cmus (all terminal programs) it isn't working. Can't run them from dmenu also. Is it ok, or i just fuckedup with my config files??

static const Rule rules[] = {
    /* xprop(1):
     *  WM_CLASS(STRING) = instance, class
     *  WM_NAME(STRING) = title
     */
    /* class      instance    title       tags mask     isfloating   monitor */
    { "Gimp",     NULL,       NULL,       0,            1,           -1 },
    { "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
    { "nvim",       NULL,       NULL,       1 << 8,       0,           -1 },
    { "ranger",     NULL,       NULL,       1 << 8,       0,           -1 },

};
static const char *web[]  = { "/usr/bin/firefox", NULL };
static const char *nvim[]  = { "/usr/share/nvim", NULL };
static const char *ranger[]  = { "/usr/bin/ranger", NULL };

{ MODKEY,                       XK_w,        spawn,                  {.v = web } },
{ MODKEY,                       XK_r,        spawn,                  {.v = ranger } },
{ MODKEY|ShiftMask,                       XK_v,          spawn,                  {.v = nvim } },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Nvim and Ranger run in the terminal, so just running the binaries won't do anything. You'll need to run them in your terminal. How that works depends on your terminal, but it is likely something like your-terminal -e ranger, or static const char *ranger[] = {"xterm", "-e", "/usr/bin/ranger", NULL }; for example.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...