Some refactor in config

Nakidai 2023-11-26 16:13:46 +03:00
parent d0d4de8613
commit 05b4af7db8
1 changed files with 39 additions and 30 deletions

View File

@ -1,10 +1,15 @@
/* See LICENSE file for copyright and license details. */ /* See LICENSE file for copyright and license details. */
#define TERMINAL "st"
#define EDITOR "nvim"
#define BROWSER "firefox"
#define SCRIPTS_PATH "/home/naki/dwmscripts/"
/* appearance */ /* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */ static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */ static const unsigned int snap = 32; /* snap pixel */
static const unsigned int cornerrad = 0; // 15 static const unsigned int cornerrad = 0;
static const unsigned int gappih = 5; // 23 static const unsigned int gappih = 5;
static const unsigned int gappiv = 5; static const unsigned int gappiv = 5;
static const unsigned int gappoh = 5; static const unsigned int gappoh = 5;
static const unsigned int gappov = 5; static const unsigned int gappov = 5;
@ -22,7 +27,6 @@ static const char *colors[][3] = {
[SchemeNorm] = { col_fg, col_bg, col_bg }, [SchemeNorm] = { col_fg, col_bg, col_bg },
[SchemeSel] = { col_fg, col_actbg, col_actwin } [SchemeSel] = { col_fg, col_actbg, col_actwin }
}; };
// [SchemeSel] = { col_gray4, col_blue, col_blue },
/* tagging */ /* tagging */
@ -35,7 +39,6 @@ static const Rule rules[] = {
*/ */
/* class instance title tags mask isfloating monitor */ /* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 }, { "Gimp", NULL, NULL, 0, 1, -1 },
// { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
}; };
/* layout(s) */ /* layout(s) */
@ -63,41 +66,47 @@ static const Layout layouts[] = {
/* commands */ /* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
// static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_bg, "-nf", col_fg, "-sb", col_actbg, "-sf", col_fg, NULL }; static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_bg, "-nf", col_fg, "-sb", col_actbg, "-sf", col_fg, NULL };
static const char *termcmd[] = { "st", NULL };
static const char *termcmd[] = { TERMINAL, NULL };
static const char *editorcmd[] = { TERMINAL, EDITOR, NULL };
static const char *volupcmd[] = { "amixer", "-D", "pulse", "sset", "Master", "5%+", "unmute", NULL }; static const char *volupcmd[] = { "amixer", "-D", "pulse", "sset", "Master", "5%+", "unmute", NULL };
static const char *voldowncmd[] = { "amixer", "-D", "pulse", "sset", "Master", "5%-", "unmute", NULL }; static const char *voldowncmd[] = { "amixer", "-D", "pulse", "sset", "Master", "5%-", "unmute", NULL };
static const char *firefoxcmd[] = { "firefox-bin", NULL };
static const char *browsercmd[] = { BROWSER, NULL };
static const char *discordcmd[] = { "discord", NULL }; static const char *discordcmd[] = { "discord", NULL };
static const char *sublcmd[] = { "subl", NULL }; static const char *scrotshcmd[] = { SCRIPTS_PATH "/scrot.sh", NULL };
static const char *scrotshcmd[] = { "/home/naki/dwmscripts/scrot.sh", NULL }; static const char *scrotpycmd[] = { "python", SCRIPTS_PATH "/scrot.py", NULL };
static const char *scrotpycmd[] = { "python", "/home/naki/dwmscripts/scrot.py", NULL }; static const char *layoutcmd[] = { "python", SCRIPTS_PATH "/layout.py", NULL };
static const char *layoutcmd[] = { "python", "/home/naki/dwmscripts/layout.py", NULL }; static const char *convertcmd[] = { SCRIPTS_PATH "/convert.sh", NULL };
static const char *convertcmd[] = { "/home/naki/dwmscripts/convert.sh", NULL }; static const char *calccmd[] = { SCRIPTS_PATH "/calc.sh", NULL };
static const char *calccmd[] = { "/home/naki/dwmscripts/calc.sh", NULL };
static Key keys[] = { static Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XK_F5, spawn, SHCMD("setxkbmap us") },
{ MODKEY, XK_F6, spawn, SHCMD("setxkbmap ru") },
{ MODKEY, XK_space, spawn, {.v = layoutcmd } }, /* Utilities */
{ 0, XK_Print, spawn, {.v = scrotshcmd } }, { MODKEY, XK_F5, spawn, SHCMD("setxkbmap us") }, /* | if kludge bottom doesn't work - */
{ MODKEY, XK_p, spawn, {.v = scrotshcmd } }, { MODKEY, XK_F6, spawn, SHCMD("setxkbmap ru") }, /* / it can change your layout */
{ MODKEY, XK_s, spawn, {.v = firefoxcmd } }, { MODKEY, XK_space, spawn, {.v = layoutcmd } }, /* kludge for switching layout */
{ MODKEY, 0x5d, spawn, {.v = volupcmd } },
{ MODKEY, 0x5b, spawn, {.v = voldowncmd } }, { 0, XK_Print, spawn, {.v = scrotshcmd } }, /* print screen */
{ 0, 0x1008ff11,spawn, {.v = voldowncmd } },
{ 0, 0x1008ff13,spawn, {.v = volupcmd } },
{ MODKEY, XK_x, spawn, {.v = discordcmd } },
{ MODKEY, XK_z, spawn, {.v = sublcmd } },
{ MODKEY, XK_v, spawn, {.v = convertcmd } }, { MODKEY, XK_v, spawn, {.v = convertcmd } },
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY, XK_c, spawn, {.v = calccmd} }, { MODKEY, XK_c, spawn, {.v = calccmd} },
{ MODKEY, XK_d, spawn, {.v = dmenucmd } }, { MODKEY, 0x5b, spawn, {.v = voldowncmd } }, /* | Multimedia keys */
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, 0x5d, spawn, {.v = volupcmd } }, /* / */
{ 0, 0x1008ff11,spawn, {.v = voldowncmd } }, /* | Wheel on my headphones */
{ 0, 0x1008ff13,spawn, {.v = volupcmd } }, /* / */
/* Apps */
{ MODKEY|ShiftMask, XK_x, spawn, {.v = discordcmd } }, /* I use discord, btw */
{ MODKEY|ShiftMask, XK_s, spawn, {.v = browsercmd } }, /* Browser */
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, /* | Terminal and editor names defined in */
{ MODKEY|ShiftMask, XK_e, spawn, {.v = editorcmd } }, /* / TERMINAL and EDITOR */
/* Other */
{ MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } },
@ -126,7 +135,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7) TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} }, { MODKEY|ShiftMask, XK_q, quit, {0} },
// gaps /* gaps */
{ MODKEY|ShiftMask, XK_g, togglegaps, {0} }, { MODKEY|ShiftMask, XK_g, togglegaps, {0} },
}; };