[wiki] [sites] [slstatus][patch][kanji] updated credits || Madison Lynch
commit 5dc49ea1bb3cdf8e3088eac5e818febc6e578446
Author: Madison Lynch <madi_AT_mxdi.xyz>
Date: Thu Jul 13 16:06:46 2023 -0700
[slstatus][patch][kanji] updated credits
diff --git a/tools.suckless.org/slstatus/patches/kanji/index.md b/tools.suckless.org/slstatus/patches/kanji/index.md
index 99a79909..bb2fd6fe 100644
--- a/tools.suckless.org/slstatus/patches/kanji/index.md
+++ b/tools.suckless.org/slstatus/patches/kanji/index.md
_AT_@ -11,4 +11,4 @@ Download
Author
------
-* Madison Lynch <madi_AT_mxdi.xyz>
+* Madison Lynch <madi_AT_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
index b5e1cce5..f72cb8f9 100644
--- a/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff
+++ b/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff
_AT_@ -1,29 +1,32 @@
---- b/config.def.h
-+++ a/config.def.h
-_AT_@ -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
-_AT_@ -0,0 +1,13 @@
-+/* See LICENSE file for copyright and license details. */
+_AT_@ -0,0 +1,14 @@
++/* Written by Madison Lynch <madi_AT_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
+_AT_@ -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
_AT_@ -14,6 +14,7 @@
_AT_@ -34,6 +37,7 @@
components/kernel_release\
components/keyboard_indicators\
components/keymap\
+
--- a/slstatus.h
+++ b/slstatus.h
_AT_@ -31,6 +31,9 @@
_AT_@ -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);
Received on Fri Jul 14 2023 - 01:09:03 CEST
This archive was generated by hypermail 2.3.0
: Fri Jul 14 2023 - 01:12:52 CEST