diff options
| -rw-r--r-- | config.def.h | 1 | ||||
| -rw-r--r-- | st.1 | 4 | ||||
| -rw-r--r-- | st.c | 26 | ||||
| -rw-r--r-- | st.h | 1 |
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 | /* |
| @@ -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 |
| 161 | Paste from the clipboard selection. | 161 | Paste from the clipboard selection. |
| 162 | .TP | ||
| 163 | .B Ctrl-Shift-i | ||
| 164 | Launch dmenu to enter a unicode codepoint and send the corresponding glyph | ||
| 165 | to st. | ||
| 166 | .SH CUSTOMIZATION | 162 | .SH CUSTOMIZATION |
| 167 | .B st | 163 | .B st |
| 168 | can be customized by creating a custom config.h and (re)compiling the source | 164 | can be customized by creating a custom config.h and (re)compiling the source |
| @@ -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 | |||
| 50 | enum term_mode { | 46 | enum 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 | ||
| 1984 | void | 1980 | void |
| 1985 | iso14755(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 | |||
| 2006 | void | ||
| 2007 | toggleprinter(const Arg *arg) | 1981 | toggleprinter(const Arg *arg) |
| 2008 | { | 1982 | { |
| 2009 | term.mode ^= MODE_PRINT; | 1983 | term.mode ^= MODE_PRINT; |
| @@ -80,7 +80,6 @@ void die(const char *, ...); | |||
| 80 | void redraw(void); | 80 | void redraw(void); |
| 81 | void draw(void); | 81 | void draw(void); |
| 82 | 82 | ||
| 83 | void iso14755(const Arg *); | ||
| 84 | void printscreen(const Arg *); | 83 | void printscreen(const Arg *); |
| 85 | void printsel(const Arg *); | 84 | void printsel(const Arg *); |
| 86 | void sendbreak(const Arg *); | 85 | void sendbreak(const Arg *); |
