aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h1
-rw-r--r--st.14
-rw-r--r--st.c26
-rw-r--r--st.h1
4 files changed, 0 insertions, 32 deletions
diff --git a/config.def.h b/config.def.h
index 82b1b09..823e79f 100644
--- a/config.def.h
+++ b/config.def.h
@@ -177,7 +177,6 @@ static Shortcut shortcuts[] = {
177 { TERMMOD, XK_V, clippaste, {.i = 0} }, 177 { TERMMOD, XK_V, clippaste, {.i = 0} },
178 { TERMMOD, XK_Y, selpaste, {.i = 0} }, 178 { TERMMOD, XK_Y, selpaste, {.i = 0} },
179 { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, 179 { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
180 { TERMMOD, XK_I, iso14755, {.i = 0} },
181}; 180};
182 181
183/* 182/*
diff --git a/st.1 b/st.1
index 81bceff..e8d6059 100644
--- a/st.1
+++ b/st.1
@@ -159,10 +159,6 @@ Copy the selected text to the clipboard selection.
159.TP 159.TP
160.B Ctrl-Shift-v 160.B Ctrl-Shift-v
161Paste from the clipboard selection. 161Paste from the clipboard selection.
162.TP
163.B Ctrl-Shift-i
164Launch dmenu to enter a unicode codepoint and send the corresponding glyph
165to st.
166.SH CUSTOMIZATION 162.SH CUSTOMIZATION
167.B st 163.B st
168can be customized by creating a custom config.h and (re)compiling the source 164can be customized by creating a custom config.h and (re)compiling the source
diff --git a/st.c b/st.c
index 76bb3ea..574dbee 100644
--- a/st.c
+++ b/st.c
@@ -38,15 +38,11 @@
38 38
39/* macros */ 39/* macros */
40#define IS_SET(flag) ((term.mode & (flag)) != 0) 40#define IS_SET(flag) ((term.mode & (flag)) != 0)
41#define NUMMAXLEN(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
42#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177') 41#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177')
43#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) 42#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
44#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) 43#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
45#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL) 44#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL)
46 45
47/* constants */
48#define ISO14755CMD "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null"
49
50enum term_mode { 46enum term_mode {
51 MODE_WRAP = 1 << 0, 47 MODE_WRAP = 1 << 0,
52 MODE_INSERT = 1 << 1, 48 MODE_INSERT = 1 << 1,
@@ -1982,28 +1978,6 @@ tprinter(char *s, size_t len)
1982} 1978}
1983 1979
1984void 1980void
1985iso14755(const Arg *arg)
1986{
1987 FILE *p;
1988 char *us, *e, codepoint[9], uc[UTF_SIZ];
1989 unsigned long utf32;
1990
1991 if (!(p = popen(ISO14755CMD, "r")))
1992 return;
1993
1994 us = fgets(codepoint, sizeof(codepoint), p);
1995 pclose(p);
1996
1997 if (!us || *us == '\0' || *us == '-' || strlen(us) > 7)
1998 return;
1999 if ((utf32 = strtoul(us, &e, 16)) == ULONG_MAX ||
2000 (*e != '\n' && *e != '\0'))
2001 return;
2002
2003 ttywrite(uc, utf8encode(utf32, uc), 1);
2004}
2005
2006void
2007toggleprinter(const Arg *arg) 1981toggleprinter(const Arg *arg)
2008{ 1982{
2009 term.mode ^= MODE_PRINT; 1983 term.mode ^= MODE_PRINT;
diff --git a/st.h b/st.h
index dac64d8..38c61c4 100644
--- a/st.h
+++ b/st.h
@@ -80,7 +80,6 @@ void die(const char *, ...);
80void redraw(void); 80void redraw(void);
81void draw(void); 81void draw(void);
82 82
83void iso14755(const Arg *);
84void printscreen(const Arg *); 83void printscreen(const Arg *);
85void printsel(const Arg *); 84void printsel(const Arg *);
86void sendbreak(const Arg *); 85void sendbreak(const Arg *);