parent
c929eb93f8
commit
4a31bdbc63
83
config.def.h
83
config.def.h
|
|
@ -1,25 +1,34 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
|
||||||
/* appearance */
|
/*
|
||||||
static unsigned int borderpx = 1; /* border pixel of windows */
|
* Appearance
|
||||||
static unsigned int snap = 32; /* snap pixel */
|
*/
|
||||||
static int showbar = 1; /* 0 means no bar */
|
static unsigned int snap = 32; /* snap pixel */
|
||||||
static int topbar = 1; /* 0 means bottom bar */
|
static char *fonts[] = { "monospace:size=14" };
|
||||||
static const char *fonts[] = { "monospace:size=10" };
|
static unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const char dmenufont[] = "monospace:size=10";
|
|
||||||
static char normbgcolor[] = "#222222";
|
static char normbgcolor[] = "#222222";
|
||||||
static char normbordercolor[] = "#444444";
|
static char normbordercolor[] = "#444444";
|
||||||
static char normfgcolor[] = "#bbbbbb";
|
static char normfgcolor[] = "#bbbbbb";
|
||||||
static char selfgcolor[] = "#eeeeee";
|
static char selfgcolor[] = "#eeeeee";
|
||||||
static char selbordercolor[] = "#005577";
|
static char selbordercolor[] = "#005577";
|
||||||
static char selbgcolor[] = "#005577";
|
static char selbgcolor[] = "#005577";
|
||||||
|
|
||||||
|
/* color schemes */
|
||||||
static char *colors[][3] = {
|
static char *colors[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
|
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
|
||||||
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
|
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/*
|
||||||
|
* Bar configuration
|
||||||
|
*/
|
||||||
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tagging
|
||||||
|
*/
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
|
|
@ -32,10 +41,12 @@ static const Rule rules[] = {
|
||||||
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/*
|
||||||
static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
* Layout(s)
|
||||||
static int nmaster = 1; /* number of clients in master area */
|
*/
|
||||||
static int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
||||||
|
static const int nmaster = 1; /* number of clients in master area */
|
||||||
|
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||||
|
|
||||||
static const Layout layouts[] = {
|
static const Layout layouts[] = {
|
||||||
|
|
@ -45,7 +56,9 @@ static const Layout layouts[] = {
|
||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/*
|
||||||
|
* Key definitions
|
||||||
|
*/
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
#define TAGKEYS(KEY,TAG) \
|
#define TAGKEYS(KEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
|
|
@ -55,12 +68,6 @@ static const Layout layouts[] = {
|
||||||
|
|
||||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", 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 };
|
|
||||||
static const char *termcmd[] = { "st", NULL };
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Xresources preferences to load at startup
|
* Xresources preferences to load at startup
|
||||||
*/
|
*/
|
||||||
|
|
@ -72,39 +79,52 @@ ResourcePref resources[] = {
|
||||||
{ "selbordercolor", STRING, &selbordercolor },
|
{ "selbordercolor", STRING, &selbordercolor },
|
||||||
{ "selfgcolor", STRING, &selfgcolor },
|
{ "selfgcolor", STRING, &selfgcolor },
|
||||||
{ "borderpx", INTEGER, &borderpx },
|
{ "borderpx", INTEGER, &borderpx },
|
||||||
{ "snap", INTEGER, &snap },
|
|
||||||
{ "showbar", INTEGER, &showbar },
|
|
||||||
{ "topbar", INTEGER, &topbar },
|
|
||||||
{ "nmaster", INTEGER, &nmaster },
|
|
||||||
{ "resizehints", INTEGER, &resizehints },
|
|
||||||
{ "mfact", FLOAT, &mfact },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Commands
|
||||||
|
*/
|
||||||
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, NULL };
|
||||||
|
static const char *termcmd[] = { "st", NULL };
|
||||||
|
|
||||||
|
|
||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
|
|
||||||
|
/* spawn programs */
|
||||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
|
|
||||||
|
/* window manager controls */
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
{ MODKEY, XK_b, togglebar, {0} },
|
||||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
|
||||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
|
||||||
{ MODKEY, XK_Tab, view, {0} },
|
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
|
||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||||
{ MODKEY, XK_space, setlayout, {0} },
|
{ MODKEY, XK_space, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
|
|
||||||
|
/* window management */
|
||||||
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
|
{ MODKEY, XK_Tab, view, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||||
|
|
||||||
|
/* monitor navigation */
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
||||||
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
||||||
|
|
||||||
|
/* tags */
|
||||||
TAGKEYS( XK_1, 0)
|
TAGKEYS( XK_1, 0)
|
||||||
TAGKEYS( XK_2, 1)
|
TAGKEYS( XK_2, 1)
|
||||||
TAGKEYS( XK_3, 2)
|
TAGKEYS( XK_3, 2)
|
||||||
|
|
@ -114,7 +134,6 @@ static Key keys[] = {
|
||||||
TAGKEYS( XK_7, 6)
|
TAGKEYS( XK_7, 6)
|
||||||
TAGKEYS( XK_8, 7)
|
TAGKEYS( XK_8, 7)
|
||||||
TAGKEYS( XK_9, 8)
|
TAGKEYS( XK_9, 8)
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
|
|
|
||||||
2
drw.c
2
drw.c
|
|
@ -154,7 +154,7 @@ xfont_free(Fnt *font)
|
||||||
}
|
}
|
||||||
|
|
||||||
Fnt*
|
Fnt*
|
||||||
drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
|
drw_fontset_create(Drw* drw, char *fonts[], size_t fontcount)
|
||||||
{
|
{
|
||||||
Fnt *cur, *ret = NULL;
|
Fnt *cur, *ret = NULL;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
|
||||||
3
drw.h
3
drw.h
|
|
@ -32,7 +32,8 @@ void drw_resize(Drw *drw, unsigned int w, unsigned int h);
|
||||||
void drw_free(Drw *drw);
|
void drw_free(Drw *drw);
|
||||||
|
|
||||||
/* Fnt abstraction */
|
/* Fnt abstraction */
|
||||||
Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount);
|
Fnt *drw_fontset_create(Drw* drw, char *fonts[], size_t fontcount);
|
||||||
|
|
||||||
void drw_fontset_free(Fnt* set);
|
void drw_fontset_free(Fnt* set);
|
||||||
unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
|
unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
|
||||||
unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n);
|
unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int n);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue