[wiki] [sites] [st] Add ISO 14755 patch || Quentin Rameau
commit 7360c80f4d2c5a24c0fc6022afdd4239e015dec3
Author: Quentin Rameau <quinq_AT_fifth.space>
Date: Tue Sep 11 13:39:26 2018 +0200
[st] Add ISO 14755 patch
diff --git a/st.suckless.org/patches/iso14755/index.md b/st.suckless.org/patches/iso14755/index.md
new file mode 100644
index 00000000..ae4d8f0b
--- /dev/null
+++ b/st.suckless.org/patches/iso14755/index.md
_AT_@ -0,0 +1,19 @@
+ISO 14755
+=========
+
+Description
+-----------
+
+Pressing the default binding Ctrl+Shift-i will popup dmenu, asking
+you to enter a unicode codepoint that will be converted to a glyph
+and then pushed to st.
+
+Download
+--------
+
+* [st-iso14755-20180911-5b850e0.diff](st-iso14755-20180911-5b850e0.diff)
+
+Authors
+-------
+
+* Quentin Rameau <quinq_AT_fifth.space>
diff --git a/st.suckless.org/patches/iso14755/st-iso14755-20180911-5b850e0.diff b/st.suckless.org/patches/iso14755/st-iso14755-20180911-5b850e0.diff
new file mode 100644
index 00000000..0d6bc517
--- /dev/null
+++ b/st.suckless.org/patches/iso14755/st-iso14755-20180911-5b850e0.diff
_AT_@ -0,0 +1,45 @@
+diff --git a/config.def.h b/config.def.h
+index 823e79f..82b1b09 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -177,6 +177,7 @@ static Shortcut shortcuts[] = {
+ { TERMMOD, XK_V, clippaste, {.i = 0} },
+ { TERMMOD, XK_Y, selpaste, {.i = 0} },
+ { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
++ { TERMMOD, XK_I, iso14755, {.i = 0} },
+ };
+
+ /*
+diff --git a/st.c b/st.c
+index aa0f0eb..76bb3ea 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -1981,6 +1981,28 @@ tprinter(char *s, size_t len)
+ }
+ }
+
++void
++iso14755(const Arg *arg)
++{
++ FILE *p;
++ char *us, *e, codepoint[9], uc[UTF_SIZ];
++ unsigned long utf32;
++
++ if (!(p = popen(ISO14755CMD, "r")))
++ return;
++
++ us = fgets(codepoint, sizeof(codepoint), p);
++ pclose(p);
++
++ if (!us || *us == '++ return;
++ if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX ||
++ (*e != '
' && *e != '++ return;
++
++ ttywrite(uc, utf8encode(utf32, uc), 1);
++}
++
+ void
+ toggleprinter(const Arg *arg)
+ {
Received on Tue Sep 11 2018 - 13:39:39 CEST
This archive was generated by hypermail 2.3.0
: Tue Sep 11 2018 - 13:48:29 CEST