sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 7360c80f4d2c5a24c0fc6022afdd4239e015dec3
parent 2b576b2d9b8f4a900e78c813882a806b06543586
Author: Quentin Rameau <quinq@fifth.space>
Date:   Tue, 11 Sep 2018 13:39:26 +0200

[st] Add ISO 14755 patch

Diffstat:
st.suckless.org/patches/iso14755/index.md | 19+++++++++++++++++++
st.suckless.org/patches/iso14755/st-iso14755-20180911-5b850e0.diff | 45+++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/iso14755/index.md b/st.suckless.org/patches/iso14755/index.md @@ -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@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 @@ -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 +@@ -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 +@@ -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 == '\0' || *us == '-' || strlen(us) > 7) ++ return; ++ if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX || ++ (*e != '\n' && *e != '\0')) ++ return; ++ ++ ttywrite(uc, utf8encode(utf32, uc), 1); ++} ++ + void + toggleprinter(const Arg *arg) + {