diff options
| author | stderr64 <stderr64@null.net> | 2026-09-09 20:09:24 +0300 |
|---|---|---|
| committer | stderr64 <stderr64@null.net> | 2026-09-09 20:09:24 +0300 |
| commit | 1e36be78dfd59325cc2d4d633a16121291d5774d (patch) | |
| tree | a8ec050a12c90926736eb3d8d638d08db45b8d3f | |
| parent | 30ea8fae68683c5541269da257eef1e6eff27fe6 (diff) | |
| download | dwm_custom-1e36be78dfd59325cc2d4d633a16121291d5774d.tar.gz dwm_custom-1e36be78dfd59325cc2d4d633a16121291d5774d.tar.zst | |
Changed color scheme to gruvbox style colors and fixed strncpy not ensuring terminating NULL byte in ltsymbol in Monitor structHEADmaster
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | config.h | 25 | ||||
| -rw-r--r-- | config.mk | 3 | ||||
| -rw-r--r-- | dwm.c | 6 |
4 files changed, 21 insertions, 15 deletions
@@ -20,7 +20,7 @@ dwm: ${OBJ} ${CC} -o $@ ${OBJ} ${LDFLAGS} clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz + rm -f dwm ${OBJ} dist: clean mkdir -p dwm-${VERSION} @@ -5,8 +5,9 @@ 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[] = { "FreeSans:regular:size=14" }; -static const char dmenufont[] = "FreeSans:bold:size=14"; +static const char *fonts[] = { "FreeMono:bold:size=14" }; +static const char dmenufont[] = "FreeMono:bold:size=14"; +/* static const char col_gray1[] = "#222222"; static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; @@ -15,13 +16,17 @@ static const char col_cyan[] = "#005577"; static const char col_orange[] = "#FF9900"; static const char col_indigo[] = "#1F1F33"; static const char col_black[] = "#000000"; +*/ +static const char col_gruvbox_bg[] = "#282828"; +static const char col_gruvbox_fg[] = "#bdae93"; +static const char col_gruvbox_ie[] = "#928374"; static const char *colors[][3] = { /* fg bg border */ - [SchemeNorm] = { col_orange, col_indigo, col_indigo }, - [SchemeSel] = { col_black, col_orange, col_orange }, - [SchemeHid] = { col_orange, col_indigo, col_orange }, - [SchemeStatusbar] = { col_indigo, col_black, col_indigo }, - [SchemeStatusbarText] = { col_orange, col_indigo, col_indigo } + [SchemeNorm] = { col_gruvbox_fg, col_gruvbox_bg, col_gruvbox_ie }, + [SchemeSel] = { col_gruvbox_bg, col_gruvbox_fg, col_gruvbox_fg }, + [SchemeHid] = { col_gruvbox_fg, col_gruvbox_bg, col_gruvbox_fg }, + [SchemeStatusbar] = { col_gruvbox_bg, col_gruvbox_bg, col_gruvbox_bg }, + [SchemeStatusbarText] = { col_gruvbox_fg, col_gruvbox_bg, col_gruvbox_bg } }; /* tagging */ @@ -69,13 +74,13 @@ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, static const char *termcmd[] = { "/usr/bin/xterm", "-fg", - "#FF9900", + "#bdae93", "-bg", - "#1A1A2C", + "#282828", "-T", "Terminal", "-fa", - "Inconsolata Medium:regular:size=14", + "FreeMono:bold:size=14", "-geometry", "80x25", "+sb", @@ -28,7 +28,8 @@ LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} +#CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -O2 -march=native -mtune=native ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -O2 -march=native -mtune=native ${INCS} ${CPPFLAGS} LDFLAGS = ${LIBS} # Solaris @@ -113,7 +113,7 @@ typedef struct { } Layout; struct Monitor { - char ltsymbol[16]; + char ltsymbol[17]; float mfact; int nmaster; int num; @@ -410,7 +410,7 @@ arrange(Monitor *m) void arrangemon(Monitor *m) { - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); + strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof(m->ltsymbol) - 1); if (m->lt[m->sellt]->arrange) m->lt[m->sellt]->arrange(m); } @@ -1636,7 +1636,7 @@ setlayout(const Arg *arg) selmon->sellt ^= 1; if (arg && arg->v) selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof(selmon->ltsymbol) - 1); if (selmon->sel) arrange(selmon); else |
