change settings, add keybinds, add default programs

This commit is contained in:
frosty 2024-09-04 00:47:45 -04:00
parent 996dc08212
commit 7db028d38a

View file

@ -1,12 +1,15 @@
/* See LICENSE file for copyright and license details. */
#define TERMINAL "st"
#define BROWSER "firefox"
/* appearance */
static unsigned int borderpx = 1; /* border pixel of windows */
static unsigned int snap = 32; /* snap pixel */
static unsigned int gappih = 10; /* horiz inner gap between windows */
static unsigned int gappiv = 10; /* vert inner gap between windows */
static unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */
static unsigned int gappov = 10; /* vert outer gap between windows and screen edge */
static unsigned int gappih = 16; /* horiz inner gap between windows */
static unsigned int gappiv = 16; /* vert inner gap between windows */
static unsigned int gappoh = 8; /* horiz outer gap between windows and screen edge */
static unsigned int gappov = 8; /* vert outer gap between windows and screen edge */
static int smartgaps = 0; /* 1 means no outer gap when there is only one window */
static int showbar = 1; /* 0 means no bar */
static int topbar = 1; /* 0 means bottom bar */
@ -34,14 +37,14 @@ static const Rule rules[] = {
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
{ "firefox", NULL, NULL, 1 << 1, 0, -1 },
{ "firefox", NULL, "Picture-in-Picture", 0, 1, -1 },
};
/* layout(s) */
static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static int nmaster = 1; /* number of clients in master area */
static int resizehints = 1; /* 1 means respect size hints in tiled resizals */
static int resizehints = 0; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const Layout layouts[] = {
@ -52,7 +55,7 @@ static const Layout layouts[] = {
};
/* key definitions */
#define MODKEY Mod1Mask
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
@ -62,6 +65,8 @@ static const Layout layouts[] = {
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
#define TERMCMD(cmd) { .v = (const char*[]){ TERMINAL, "-e", cmd, NULL } }
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
@ -98,21 +103,25 @@ ResourcePref resources[] = {
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_w, spawn, SHCMD(BROWSER) },
{ MODKEY, XK_v, spawn, TERMCMD("pulsemixer") },
{ MODKEY, XK_e, spawn, SHCMD("thunar") },
{ ControlMask|Mod1Mask, XK_u, spawn, TERMCMD("htop") },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY|ControlMask, XK_j, pushdown, {0} },
{ MODKEY|ControlMask, XK_k, pushup, {0} },
{ MODKEY|ShiftMask, XK_j, pushdown, {0} },
{ MODKEY|ShiftMask, XK_k, pushup, {0} },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } },
{ MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } },
{ MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
{ MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_h, setmfact, {.f = -0.0125} },
{ MODKEY, XK_l, setmfact, {.f = +0.0125} },
{ MODKEY, XK_bracketright, incrgaps, {.i = +4 } },
{ MODKEY, XK_bracketleft, incrgaps, {.i = -4 } },
{ MODKEY, XK_equal, togglegaps, {0} },
{ MODKEY|ShiftMask, XK_equal, defaultgaps, {0} },
{ MODKEY|ShiftMask, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
@ -121,7 +130,7 @@ static const Key keys[] = {
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
{ MODKEY, XK_s, togglesticky, {0} },
{ MODKEY|ShiftMask, XK_s, togglesticky, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_y, shiftview, {.i = +1 } },
@ -139,7 +148,8 @@ static const Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ ControlMask|Mod1Mask, XK_r, quit, {0} },
{ ControlMask|Mod1Mask, XK_Delete, spawn, SHCMD("pkill xinit") },
};
/* button definitions */
@ -158,4 +168,3 @@ static const Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};