This commit is contained in:
speedie 2023-07-06 21:20:15 +02:00
parent 8df587814c
commit 2ca7ccf553
2 changed files with 11 additions and 5 deletions

View file

@ -125,15 +125,13 @@ static const Layout layouts[] = {
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
static const char *spmenucmd[] = { "spmenu_run", "-x", NULL };
static const char *spmenucmd_d[] = { "spmenu_run", "-d", NULL };
static const char *termcmd[] = { "st", NULL };
static const char *browser[] = { "chromium", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_semicolon, spawn, {.v = spmenucmd_d } },
{ MODKEY|ShiftMask, XK_semicolon, spawn, {.v = spmenucmd } },
{ MODKEY, XK_semicolon, spawn, SHCMD("spmenu_run -d -a '-a Run'") },
{ MODKEY|ShiftMask, XK_semicolon, spawn, SHCMD("spmenu_run -x -a '-a Run'") },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_w, spawn, {.v = browser } },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("screenshot-spmenu -s") },
@ -178,7 +176,6 @@ static const Key keys[] = {
{ MODKEY|ControlMask, XK_z, showhideclient, {0} },
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ Mod1Mask|ControlMask, XK_w, rotatelayoutaxis, {.i = +1 } }, /* flextile, 1 = layout axis */
{ Mod1Mask|ControlMask, XK_e, rotatelayoutaxis, {.i = +2 } }, /* flextile, 2 = master axis */
@ -191,6 +188,7 @@ static const Key keys[] = {
{ MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, /* flextile, flip master and stack areas */
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_f, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },

8
dwm.c
View file

@ -325,6 +325,7 @@ static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
static void togglefullscr(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus);
@ -2499,6 +2500,13 @@ togglefloating(const Arg *arg)
arrange(selmon);
}
void
togglefullscr(const Arg *arg)
{
if(selmon->sel)
setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}
void
toggletag(const Arg *arg)
{