New motherf**king keybindings

master
Ronald Reagan 7 years ago
parent b6934a000a
commit 73d8f2822a

@ -25,6 +25,8 @@ static const Rule rules[] = {
{ "st-256color", NULL, "ncmpcpp", 0, 1, 1, -1 },
{ "st-256color", NULL, "tmux", 0, 1, 1, -1 },
{ "st-256color", NULL, "htop", 0, 1, 1, -1 },
{ "st-256color", NULL, "newsboat", 0, 1, 1, -1 },
{ "st-256color", "floating", NULL, 0, 1, 1, -1 },
};
@ -55,6 +57,7 @@ static const Layout layouts[] = {
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", NULL };
static const char *termcmd[] = { "st", NULL };
static const char *ftermcmd[] = { "st", "-n", "floating", NULL };
static const char *webcmd[] = { "qutebrowser", NULL };
static const char *notcmd[] = { "notinfo", NULL };
@ -63,6 +66,7 @@ static const char *mutecmd[] = { "pulsemixer", "--toggle-mute", NULL };
static const char *volcmd[] = { "st", "-e", "pulsemixer", NULL };
static const char *lockcmd[] = { "slock", NULL };
static const char *filecmd[] = { "st", "-e", "lf", NULL };
static const char *ffilecmd[] = { "st", "-n", "floating", "-e", "lf", NULL };
static const char *musiccmd[] = { "st", "-e", "ncmpcpp", NULL };
static const char *ssacmd[] = { "ssall", NULL };
static const char *ssscmd[] = { "ssselection", NULL };
@ -72,12 +76,14 @@ static const char *mailcmd[] = { "st", "-e", "neomutt", NULL };
static const char *tmuxcmd[] = { "st", "-e", "tmux", "a", NULL };
static const char *htopcmd[] = { "st", "-e", "htop", NULL };
static const char *nmcmd[] = { "st", "-e", "nmtui", NULL };
static const char *newscmd[] = { "st", "-e", "newsboat", NULL };
#include "movestack.c"
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ControlMask, XK_Return, spawn, {.v = ftermcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
@ -117,6 +123,7 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_t, spawn, {.v = notcmd } },
{ MODKEY, XK_v, spawn, {.v = volcmd } },
{ MODKEY, XK_r, spawn, {.v = filecmd } },
{ MODKEY|ShiftMask, XK_r, spawn, {.v = ffilecmd } },
{ MODKEY|ShiftMask, XK_v, spawn, {.v = musiccmd } },
{ MODKEY, XK_s, spawn, {.v = ssacmd } },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = ssscmd } },
@ -126,7 +133,9 @@ static Key keys[] = {
{ MODKEY, XK_e, spawn, {.v = transcmd } },
{ MODKEY, XK_w, spawn, {.v = mailcmd } },
{ MODKEY, XK_n, spawn, {.v = nmcmd } },
{ MODKEY|ShiftMask, XK_n, spawn, {.v = newscmd } },
{ MODKEY, XK_c, spawn, {.v = mutecmd } },
{ MODKEY, XK_slash, setcentered, {0} },
};
/* button definitions */

BIN
dwm

Binary file not shown.

14
dwm.c

@ -199,6 +199,7 @@ static void run(void);
static void scan(void);
static int sendevent(Client *c, Atom proto);
static void sendmon(Client *c, Monitor *m);
static void setcentered(const Arg *arg);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen);
@ -588,6 +589,19 @@ configurenotify(XEvent *e)
}
}
void
setcentered(const Arg *arg)
{
if (!selmon->sel)
return;
selmon->sel->iscentered = !selmon->sel->isfixed;
if (selmon->sel->iscentered) {
selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2;
selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2;
}
arrange(selmon);
}
void
configurerequest(XEvent *e)
{

BIN
dwm.o

Binary file not shown.
Loading…
Cancel
Save