commit 5dc49ea1bb3cdf8e3088eac5e818febc6e578446
parent 77a71712f0d34efdd594addd4f4dd1058b8a3f30
Author: Madison Lynch <madi@mxdi.xyz>
Date: Thu, 13 Jul 2023 16:06:46 -0700
[slstatus][patch][kanji] updated credits
Diffstat:
2 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/tools.suckless.org/slstatus/patches/kanji/index.md b/tools.suckless.org/slstatus/patches/kanji/index.md
@@ -11,4 +11,4 @@ Download
Author
------
-* Madison Lynch <madi@mxdi.xyz>
+* Madison Lynch <madi@mxdi.xyz>
+\ No newline at end of file
diff --git a/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff b/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff
@@ -1,29 +1,32 @@
---- b/config.def.h
-+++ a/config.def.h
-@@ -31,6 +31,7 @@
- * hostname hostname NULL
- * ipv4 IPv4 address interface name (eth0)
- * ipv6 IPv6 address interface name (eth0)
-+ * kanji japanese day of week kanji NULL
- * kernel_release `uname -r` NULL
- * keyboard_indicators caps/num lock indicators format string (c?n?)
- * see keyboard_indicators.c
--- a/components/kanji.c
+++ b/components/kanji.c
-@@ -0,0 +1,13 @@
-+/* See LICENSE file for copyright and license details. */
+@@ -0,0 +1,14 @@
++/* Written by Madison Lynch <madi@mxdi.xyz> */
+#include <time.h>
+
+const char *
+kanji(const char *unused) {
-+ char *kanji[]={"日","月","火","水","木","金","土"};
-+ int map[]={0,3,2,5,0,3,5,1,4,6,2,4};
++ char *kanji[] = {"日", "月", "火", "水", "木", "金", "土"};
+ time_t t=time(NULL);
+ struct tm tm=*localtime(&t);
-+ int m=tm.tm_mon+1,y=tm.tm_year+1900-(m<3);
-+ int wd=(y+y/4-y/100+y/400+map[m-1]+tm.tm_mday)%7;
++ int map[]={0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4},
++ m=tm.tm_mon+1,
++ y=tm.tm_year+1900-(m<3),
++ wd=(y+y/4-y/100+y/400+map[m-1]+tm.tm_mday)%7;
+ return kanji[wd];
+}
+
+--- a/config.def.h
++++ b/config.def.h
+@@ -31,6 +31,7 @@
+ * hostname hostname NULL
+ * ipv4 IPv4 address interface name (eth0)
+ * ipv6 IPv6 address interface name (eth0)
++ * kanji japanese day of week kanji NULL
+ * kernel_release `uname -r` NULL
+ * keyboard_indicators caps/num lock indicators format string (c?n?)
+ * see keyboard_indicators.c
+
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@
@@ -34,6 +37,7 @@
components/kernel_release\
components/keyboard_indicators\
components/keymap\
+
--- a/slstatus.h
+++ b/slstatus.h
@@ -31,6 +31,9 @@
@@ -44,4 +48,4 @@
+const char *kanji(const char *unused);
+
/* kernel_release */
- const char *kernel_release(const char *unused);
-\ No newline at end of file
+ const char *kernel_release(const char *unused);