sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 65833e3048b0f9a55f300863b07c37ef32df5f0a
parent 058b8a975bf5392135baa62f40c2aa0648d3a8f9
Author: GasparVardanyan <gaspar_pm@protonmail.com>
Date:   Fri, 25 Mar 2022 01:30:42 +0400

[dwm][patch][xtheme] apply a new version

Diffstat:
Adwm.suckless.org/patches/xtheme/dwm-xtheme-20220325-012830-dwm-6.3.diff | 167+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/xtheme/index.md | 1+
2 files changed, 168 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/xtheme/dwm-xtheme-20220325-012830-dwm-6.3.diff b/dwm.suckless.org/patches/xtheme/dwm-xtheme-20220325-012830-dwm-6.3.diff @@ -0,0 +1,167 @@ +diff --git a/Makefile b/Makefile +index 77bcbc0..fadb218 100644 +--- a/Makefile ++++ b/Makefile +@@ -17,16 +17,23 @@ options: + .c.o: + ${CC} -c ${CFLAGS} $< + +-${OBJ}: config.h config.mk ++${OBJ}: config.h theme_beg.h config.mk + +-config.h: +- cp config.def.h $@ ++theme.h: ++ ./xtheme ++ ++theme_beg.h: ++ ./themesetup ++ ++config.h: theme.h ++ cp -n config.def.h $@ + + dwm: ${OBJ} + ${CC} -o $@ ${OBJ} ${LDFLAGS} ++ rm -f theme_{beg,end}.h + + clean: +- rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz ++ rm -f dwm ${OBJ} theme_{beg,end}.h dwm-${VERSION}.tar.gz + + dist: clean + mkdir -p dwm-${VERSION} +diff --git a/config.def.h b/config.def.h +index a2ac963..359c520 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -1,11 +1,15 @@ + /* See LICENSE file for copyright and license details. */ + ++/* theme management */ ++# include "theme_beg.h" /* this is a compile-time generated header file */ ++# include "theme.h" ++ + /* 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 unsigned int borderpx = DWM_BORDERPX; /* border pixel of windows */ ++static const unsigned int snap = DWM_SNAP; /* snap pixel */ ++static const int showbar = DWM_SHOWBAR; /* 0 means no bar */ ++static const int topbar = DWM_TOPBAR; /* 0 means bottom bar */ ++static const char *fonts[] = DWM_FONT; + static const char dmenufont[] = "monospace:size=10"; + static const char col_gray1[] = "#222222"; + static const char col_gray2[] = "#444444"; +@@ -13,9 +17,9 @@ static const char col_gray3[] = "#bbbbbb"; + static const char col_gray4[] = "#eeeeee"; + static const char col_cyan[] = "#005577"; + static const char *colors[][3] = { +- /* fg bg border */ +- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, +- [SchemeSel] = { col_gray4, col_cyan, col_cyan }, ++ /* fg bg border */ ++ [SchemeNorm] = { DWM_FOREGROUND, DWM_BACKGROUND, DWM_BORDER }, ++ [SchemeSel] = { DWM_SELFOREGROUND, DWM_SELBACKGROUND, DWM_SELBORDER }, + }; + + /* tagging */ +@@ -60,6 +64,9 @@ 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 *termcmd[] = { "st", NULL }; + ++/* theme management */ ++# include "theme_end.h" /* this is a compile-time generated header file */ ++ + static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, +diff --git a/themesetup b/themesetup +new file mode 100755 +index 0000000..e8710c1 +--- /dev/null ++++ b/themesetup +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++echo \# if $(cat theme.h | cut -d' ' -f3 | sed "s/^/defined /;s/$/ ||/" | tr "\n" " ") 0 > theme_beg.h ++echo -e "# error (conflicting macro names)\n# endif" >> theme_beg.h ++cat theme.h | cut -d' ' -f3 | sed "s/^/# undef /;" > theme_end.h +diff --git a/xtable.md b/xtable.md +new file mode 100644 +index 0000000..ff87701 +--- /dev/null ++++ b/xtable.md +@@ -0,0 +1,13 @@ ++| TYPE | RESOURCE | DEFAULT VALUE | [ALTERNATIVE RESOURCE] | ++|:---------:|:-----------------:|:---------------------:|:-------------------------:| ++| U | borderpx | 1 | | ++| U | snap | 32 | | ++| I | showbar | 1 | | ++| I | topbar | 1 | | ++| SA | font | monospace:size=10 | | ++| S | foreground | #93a1a1 | | ++| S | background | #002b36 | | ++| S | border | #93a1a1 | background | ++| S | selforeground | #073642 | background | ++| S | selbackground | #2aa198 | foreground | ++| S | selborder | #cb4b16 | foreground | +diff --git a/xtheme b/xtheme +new file mode 100755 +index 0000000..9384673 +--- /dev/null ++++ b/xtheme +@@ -0,0 +1,51 @@ ++#!/bin/sh ++ ++prefix=dwm ++themeout=theme.h ++xtable=xtable.md ++ ++rm -f $themeout ++ ++set_resource () ++{ ++ T=$1 ++ M=$2 ++ V=$3 ++ ++ case $T in ++ S) ++ V=\"$V\" ++ ;; ++ SA) ++ V="{\"$(echo $V | sed 's/, /", "/g')\"}" ++ esac ++ ++ [[ $V == '{""}' ]] && V="{}" ++ ++ echo "# define $M $V" >> $themeout ++} ++ ++cat "$xtable" | ++ sed '1,2d;s/\t*|\t*/|/g;s/\(^|\)\|\(|$\)//g' | ++ while IFS='|' read T R D A ++ do ++ m=$(echo "$prefix"'_'"$R" | tr '[:lower:]' '[:upper:]') ++ ++ l='' ++ ++ for r in "$R" "$A" ++ do ++ [[ "$r" == '' ]] && continue ++ ++ l=$(xgetres "$prefix.$r") ++ ++ if [[ "$l" != '' ]] ++ then ++ set_resource $T $m "$l" ++ break ++ fi ++ done ++ ++ [[ "$l" == '' ]] && ++ set_resource $T $m "$D" ++ done diff --git a/dwm.suckless.org/patches/xtheme/index.md b/dwm.suckless.org/patches/xtheme/index.md @@ -11,6 +11,7 @@ Download * [dwm-xtheme-20220214-135624-dwm-6.3.diff](dwm-xtheme-20220214-135624-dwm-6.3.diff) * [dwm-xtheme-20220216-044040-dwm-6.3.diff](dwm-xtheme-20220216-044040-dwm-6.3.diff) * [dwm-xtheme-20220218-001337-dwm-6.3.diff](dwm-xtheme-20220218-001337-dwm-6.3.diff) +* [dwm-xtheme-20220325-012830-dwm-6.3.diff](dwm-xtheme-20220325-012830-dwm-6.3.diff) Authors