st-xtheme-20220128-063347-st-0.8.5.diff (5959B)
1 diff '--color=auto' -uraN st-0.8.5/config.def.h st-xtheme/config.def.h 2 --- st-0.8.5/config.def.h 2022-01-07 15:41:35.000000000 +0400 3 +++ st-xtheme/config.def.h 2022-01-28 06:13:11.486859924 +0400 4 @@ -1,5 +1,9 @@ 5 /* See LICENSE file for copyright and license details. */ 6 7 +/* theme management */ 8 +# include "theme_beg.h" /* this is a compile-time generated header file */ 9 +# include "theme.h" 10 + 11 /* 12 * appearance 13 * 14 @@ -96,34 +100,36 @@ 15 /* Terminal colors (16 first used in escape sequence) */ 16 static const char *colorname[] = { 17 /* 8 normal colors */ 18 - "black", 19 - "red3", 20 - "green3", 21 - "yellow3", 22 - "blue2", 23 - "magenta3", 24 - "cyan3", 25 - "gray90", 26 + ST_COLOR0, 27 + ST_COLOR1, 28 + ST_COLOR2, 29 + ST_COLOR3, 30 + ST_COLOR4, 31 + ST_COLOR5, 32 + ST_COLOR6, 33 + ST_COLOR7, 34 35 /* 8 bright colors */ 36 - "gray50", 37 - "red", 38 - "green", 39 - "yellow", 40 - "#5c5cff", 41 - "magenta", 42 - "cyan", 43 - "white", 44 + ST_COLOR8, 45 + ST_COLOR9, 46 + ST_COLOR10, 47 + ST_COLOR11, 48 + ST_COLOR12, 49 + ST_COLOR13, 50 + ST_COLOR14, 51 + ST_COLOR15, 52 53 [255] = 0, 54 55 /* more colors can be added after 255 to use with DefaultXX */ 56 - "#cccccc", 57 - "#555555", 58 - "gray90", /* default foreground colour */ 59 - "black", /* default background colour */ 60 + ST_CURSORCOLOR, 61 + ST_REVCURCOLOR, 62 + ST_FOREGROUND, /* default foreground colour */ 63 + ST_BACKGROUND, /* default background colour */ 64 }; 65 66 +/* theme management */ 67 +# include "theme_end.h" /* this is a compile-time generated header file */ 68 69 /* 70 * Default colors (colorname index) 71 diff '--color=auto' -uraN st-0.8.5/Makefile st-xtheme/Makefile 72 --- st-0.8.5/Makefile 2022-01-07 15:41:35.000000000 +0400 73 +++ st-xtheme/Makefile 2022-01-28 06:24:02.729486753 +0400 74 @@ -18,19 +18,27 @@ 75 config.h: 76 cp config.def.h config.h 77 78 +theme.h: 79 + chmod +x ./xtheme ./themesetup 80 + ./xtheme 81 + 82 +theme: theme.h 83 + ./themesetup 84 + 85 .c.o: 86 $(CC) $(STCFLAGS) -c $< 87 88 -st.o: config.h st.h win.h 89 -x.o: arg.h config.h st.h win.h 90 +st.o: config.h st.h theme win.h 91 +x.o: arg.h config.h st.h theme win.h 92 93 -$(OBJ): config.h config.mk 94 +$(OBJ): config.h theme config.mk 95 96 st: $(OBJ) 97 $(CC) -o $@ $(OBJ) $(STLDFLAGS) 98 + rm theme_{beg,end}.h 99 100 clean: 101 - rm -f st $(OBJ) st-$(VERSION).tar.gz 102 + rm -f st $(OBJ) theme_{beg,end}.h st-$(VERSION).tar.gz 103 104 dist: clean 105 mkdir -p st-$(VERSION) 106 @@ -54,4 +62,4 @@ 107 rm -f $(DESTDIR)$(PREFIX)/bin/st 108 rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1 109 110 -.PHONY: all options clean dist install uninstall 111 +.PHONY: all options clean dist install uninstall theme 112 diff '--color=auto' -uraN st-0.8.5/themes/leet.h st-xtheme/themes/leet.h 113 --- st-0.8.5/themes/leet.h 1970-01-01 04:00:00.000000000 +0400 114 +++ st-xtheme/themes/leet.h 2022-01-28 06:10:04.064533316 +0400 115 @@ -0,0 +1,21 @@ 116 +# define ST_ALPHA .75F 117 +# define ST_FOREGROUND "#FF0000" 118 +# define ST_BACKGROUND "#080000" 119 +# define ST_CURSORCOLOR "#D40000" 120 +# define ST_REVCURCOLOR "#FF0000" 121 +# define ST_COLOR0 "#010008" 122 +# define ST_COLOR1 "#A71B1A" 123 +# define ST_COLOR2 "#3B8526" 124 +# define ST_COLOR3 "#E49202" 125 +# define ST_COLOR4 "#1D576D" 126 +# define ST_COLOR5 "#97219C" 127 +# define ST_COLOR6 "#24866F" 128 +# define ST_COLOR7 "#B5AD64" 129 +# define ST_COLOR8 "#1C1C1C" 130 +# define ST_COLOR9 "#BF3130" 131 +# define ST_COLOR10 "#58A642" 132 +# define ST_COLOR11 "#FFB026" 133 +# define ST_COLOR12 "#4169E1" 134 +# define ST_COLOR13 "#A7248C" 135 +# define ST_COLOR14 "#37A48D" 136 +# define ST_COLOR15 "#CEC67D" 137 diff '--color=auto' -uraN st-0.8.5/themes/redish.h st-xtheme/themes/redish.h 138 --- st-0.8.5/themes/redish.h 1970-01-01 04:00:00.000000000 +0400 139 +++ st-xtheme/themes/redish.h 2022-01-28 06:10:04.064533316 +0400 140 @@ -0,0 +1,21 @@ 141 +# define ST_ALPHA 1.F 142 +# define ST_FOREGROUND "#FF0000" 143 +# define ST_BACKGROUND "#1C0F0F" 144 +# define ST_CURSORCOLOR "#D40000" 145 +# define ST_REVCURCOLOR "#FF0000" 146 +# define ST_COLOR0 "#1C0F11" 147 +# define ST_COLOR1 "#752323" 148 +# define ST_COLOR2 "#D96767" 149 +# define ST_COLOR3 "#FF0000" 150 +# define ST_COLOR4 "#523F3F" 151 +# define ST_COLOR5 "#993131" 152 +# define ST_COLOR6 "#B45050" 153 +# define ST_COLOR7 "#735050" 154 +# define ST_COLOR8 "#806060" 155 +# define ST_COLOR9 "#C02F2F" 156 +# define ST_COLOR10 "#D76262" 157 +# define ST_COLOR11 "#FF0000" 158 +# define ST_COLOR12 "#7E4F4F" 159 +# define ST_COLOR13 "#FF1111" 160 +# define ST_COLOR14 "#FF8A8A" 161 +# define ST_COLOR15 "#8C6161" 162 diff '--color=auto' -uraN st-0.8.5/themesetup st-xtheme/themesetup 163 --- st-0.8.5/themesetup 1970-01-01 04:00:00.000000000 +0400 164 +++ st-xtheme/themesetup 2022-01-28 06:10:04.064533316 +0400 165 @@ -0,0 +1,5 @@ 166 +#!/bin/sh 167 + 168 +echo \# if $(cat theme.h | cut -d' ' -f3 | sed "s/^/defined /;s/$/ ||/" | tr "\n" " ") 0 > theme_beg.h 169 +echo -e "# error (conflicting macro names)\n# endif" >> theme_beg.h 170 +cat theme.h | cut -d' ' -f3 | sed "s/^/# undef /;" > theme_end.h 171 diff '--color=auto' -uraN st-0.8.5/xresources.list st-xtheme/xresources.list 172 --- st-0.8.5/xresources.list 1970-01-01 04:00:00.000000000 +0400 173 +++ st-xtheme/xresources.list 2022-01-28 06:10:04.064533316 +0400 174 @@ -0,0 +1,21 @@ 175 +alpha 176 +foreground " 177 +background " 178 +cursorColor " 179 +revCurColor " 180 +color0 " 181 +color1 " 182 +color2 " 183 +color3 " 184 +color4 " 185 +color5 " 186 +color6 " 187 +color7 " 188 +color8 " 189 +color9 " 190 +color10 " 191 +color11 " 192 +color12 " 193 +color13 " 194 +color14 " 195 +color15 " 196 diff '--color=auto' -uraN st-0.8.5/xtheme st-xtheme/xtheme 197 --- st-0.8.5/xtheme 1970-01-01 04:00:00.000000000 +0400 198 +++ st-xtheme/xtheme 2022-01-28 06:10:04.064533316 +0400 199 @@ -0,0 +1,40 @@ 200 +#!/bin/sh 201 + 202 +prefix=st 203 +resfile=xresources.list 204 +themeout=theme.h 205 +themedefault=themes/leet.h 206 + 207 +rm -f $themeout 208 + 209 +cat "$resfile" | while read r s 210 +do 211 + m=ST_$(echo $r | tr '[:lower:]' '[:upper:]') 212 + 213 + echo -e "$prefix\n" | 214 + { 215 + l='' 216 + 217 + while read p 218 + do 219 + l="$( \ 220 + xrdb -query \ 221 + | grep -P "^$p\*?\.?$r:\s*\S*$" -m 1 \ 222 + | sed "s/^$p\*\?\.\?$r:\s*\(\S*\)$/# define $m $s\1$s/" \ 223 + )" 224 + 225 + if [[ "$l" != '' ]] 226 + then 227 + echo "$l" >> $themeout 228 + break 229 + fi 230 + done 231 + 232 + if [[ "$l" == '' ]] 233 + then 234 + cat "$themedefault" | grep -P "# define $m " >> $themeout 235 + fi 236 + } 237 +done 238 + 239 +./themesetup