Implement lightmode/darkmode patch

This commit is contained in:
2026-01-14 14:54:10 +01:00
parent 5bbe65082c
commit 0a93955264
2 changed files with 104 additions and 30 deletions
+37 -21
View File
@@ -1,21 +1,36 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char *colors[][3] = {
#define FONT "FiraCodeNerdFont:size=11:antialias=true:autohint=true"
/* appearance */
static const unsigned int borderpx = 3; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { FONT };
static const char dmenufont[] = FONT;
// Dark colors
static const char col_dark1[] = "#11111b";
static const char col_dark2[] = "#45475a";
static const char col_dark3[] = "#7f849c";
static const char col_dark4[] = "#cdd6f4"; //text
static const char col_lavender_dark[] = "#b4befe";
// Light colors
static const char col_light1[] = "#dce0e8";
static const char col_light2[] = "#bcc0cc";
static const char col_light3[] = "#8c8fa1";
static const char col_light4[] = "#4c4f69"; //text
static const char col_lavender_light[] = "#7287fd";
static const char *colorslight[][3] = {
/* fg bg border */
[SchemeNorm] = { col_light3, col_light1, col_light2 },
[SchemeSel] = { col_light4, col_light2, col_lavender_light },
};
static const char *colorsdark[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
[SchemeNorm] = { col_dark1, col_dark3, col_dark2 },
[SchemeSel] = { col_dark4, col_dark2, col_lavender_dark },
};
/* tagging */
@@ -27,8 +42,8 @@ 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 },
{ "Terminal", NULL, NULL, 0, 1, -1 },
{ "Reader", NULL, NULL, 1 << 8, 0, -1 },
};
/* layout(s) */
@@ -36,7 +51,7 @@ 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 refreshrate = 120; /* refresh rate (per second) for client move/resize */
static const int refreshrate = 60; /* refresh rate (per second) for client move/resize */
static const Layout layouts[] = {
/* symbol arrange function */
@@ -57,13 +72,14 @@ static const Layout layouts[] = {
#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", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static char dmenumon[2] = "0"; /* component of dmenu{dark,light}, manipulated in spawndmenu() */
static const char *dmenudark[] = { "dmenu_run", "-m", dmenumon, "-i", "-fn", dmenufont, "-nb", col_dark1, "-nf", col_dark3, "-sb", col_lavender_dark, "-sf", col_dark4, NULL };
static const char *dmenulight[] = { "dmenu_run", "-m", dmenumon, "-i", "-fn", dmenufont, "-nb", col_light1, "-nf", col_light3, "-sb", col_lavender_light, "-sf", col_light4, NULL };
static const char *termcmd[] = { "st", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY, XK_p, spawndmenu, {0} },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },