[wiki] [sites] [st][iso14755] Update patch for 0.8.5 release || Alvar Penning
commit 5f981fce2f7be79ebcd7544f54bc9aa9e290fa32
Author: Alvar Penning <post_AT_0x21.biz>
Date: Sat Mar 12 12:29:36 2022 +0100
[st][iso14755] Update patch for 0.8.5 release
diff --git a/st.suckless.org/patches/iso14755/index.md b/st.suckless.org/patches/iso14755/index.md
index 5d0204de..bb173bd3 100644
--- a/st.suckless.org/patches/iso14755/index.md
+++ b/st.suckless.org/patches/iso14755/index.md
_AT_@ -8,6 +8,7 @@ a unicode codepoint that will be converted to a glyph and then pushed to st.
Download
--------
+* [st-iso14755-0.8.5.diff](st-iso14755-0.8.5.diff)
* [st-iso14755-0.8.3.diff](st-iso14755-0.8.3.diff)
* [st-iso14755-0.8.2.diff](st-iso14755-0.8.2.diff)
* [st-iso14755-20180911-67d0cb6.diff](st-iso14755-20180911-67d0cb6.diff)
diff --git a/st.suckless.org/patches/iso14755/st-iso14755-0.8.5.diff b/st.suckless.org/patches/iso14755/st-iso14755-0.8.5.diff
new file mode 100644
index 00000000..adaedb46
--- /dev/null
+++ b/st.suckless.org/patches/iso14755/st-iso14755-0.8.5.diff
_AT_@ -0,0 +1,89 @@
+diff --git a/config.def.h b/config.def.h
+index 91ab8ca..6d1aee0 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -170,6 +170,11 @@ static unsigned int defaultattr = 11;
+ */
+ static uint forcemousemod = ShiftMask;
+
++/*
++ * Command used to query unicode glyphs.
++ */
++char *iso14755_cmd = "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null";
++
+ /*
+ * Internal mouse shortcuts.
+ * Beware that overloading Button1 will disable the selection.
+_AT_@ -201,6 +206,7 @@ static Shortcut shortcuts[] = {
+ { TERMMOD, XK_Y, selpaste, {.i = 0} },
+ { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
++ { TERMMOD, XK_I, iso14755, {.i = 0} },
+ };
+
+ /*
+diff --git a/st.1 b/st.1
+index 39120b4..4a98626 100644
+--- a/st.1
++++ b/st.1
+_AT_@ -159,6 +159,10 @@ Copy the selected text to the clipboard selection.
+ .TP
+ .B Ctrl-Shift-v
+ Paste from the clipboard selection.
++.TP
++.B Ctrl-Shift-i
++Launch dmenu to enter a unicode codepoint and send the corresponding glyph
++to st.
+ .SH CUSTOMIZATION
+ .B st
+ can be customized by creating a custom config.h and (re)compiling the source
+diff --git a/st.c b/st.c
+index 51049ba..308162b 100644
+--- a/st.c
++++ b/st.c
+_AT_@ -2068,6 +2068,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(iso14755_cmd, "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)
+ {
+diff --git a/st.h b/st.h
+index 519b9bd..51aa1ae 100644
+--- a/st.h
++++ b/st.h
+_AT_@ -81,6 +81,7 @@ void die(const char *, ...);
+ void redraw(void);
+ void draw(void);
+
++void iso14755(const Arg *);
+ void printscreen(const Arg *);
+ void printsel(const Arg *);
+ void sendbreak(const Arg *);
+_AT_@ -126,3 +127,4 @@ extern unsigned int tabspaces;
+ extern unsigned int defaultfg;
+ extern unsigned int defaultbg;
+ extern unsigned int defaultcs;
++extern char *iso14755_cmd;
Received on Sat Mar 12 2022 - 12:29:49 CET
This archive was generated by hypermail 2.3.0
: Sat Mar 12 2022 - 12:36:53 CET