From 68bae9c7b121e30114f6b0cabe15da3fae46e673 Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Sat, 8 Oct 2016 16:22:18 +0200 Subject: Add support for iso14755 We launch dmenu for getting a codepoint, then convert it and send it to the terminal. --- st.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'st.c') diff --git a/st.c b/st.c index 6c16386..c67623f 100644 --- a/st.c +++ b/st.c @@ -66,6 +66,7 @@ char *argv0; #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) < (b) ? (b) : (a)) #define LEN(a) (sizeof(a) / sizeof(a)[0]) +#define NUMMAXLEN(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) #define DEFAULT(a, b) (a) = (a) ? (a) : (b) #define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) #define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) @@ -87,6 +88,8 @@ char *argv0; #define TRUEGREEN(x) (((x) & 0xff00)) #define TRUEBLUE(x) (((x) & 0xff) << 8) +/* constants */ +#define ISO14755CMD "dmenu -w %lu -p codepoint: 7) + return; + if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX || + (*e != '\n' && *e != '\0')) + return; + + ttysend(uc, utf8encode(utf32, uc)); +} + void toggleprinter(const Arg *arg) { -- cgit v1.2.1