st

my build of st - simple terminal
git clone git://git.kocotian.pl/st.git
Log | Files | Refs | README | LICENSE

commit 8614a3de3c5b1af4bcc7ce6ad5d5532e920af8a0
parent cc551334fa2ad8edff265e6bba7afd2f95195f52
Author: kocotian <kocotian@kocotian.pl>
Date:   Wed, 23 Dec 2020 20:13:24 +0100

clipboard, externalpipe commands, README change

Diffstat:
MREADME | 2+-
Mconfig.def.h | 20++++++++++++++++----
2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/README b/README @@ -1,5 +1,6 @@ st - simple terminal -------------------- +kocotian <kocotian@kocotian.pl> build st is a simple terminal emulator for X which sucks less. @@ -31,4 +32,3 @@ See the man page for additional details. Credits ------- Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code. - diff --git a/config.def.h b/config.def.h @@ -193,9 +193,18 @@ static MouseShortcut mshortcuts[] = { { XK_ANY_MOD, Button5, ttysend, {.s = "\005"} }, }; + +static char *openurlcmd[] = { "/bin/sh", "-c", "st-urlhandler", "externalpipe", NULL }; + +static char *copyurlcmd[] = { "/bin/sh", "-c", + "tmp=$(sed 's/.*│//g' | tr -d '\n' | grep -aEo '(((http|https|gopher|gemini|ftp|ftps|git)://|www\\.)[a-zA-Z0-9.]*[:]?[a-zA-Z0-9./@$&%?$#=_-~]*)|((magnet:\\?xt=urn:btih:)[a-zA-Z0-9]*)' | uniq | sed 's/^www./http:\\/\\/www\\./g' ); IFS=; [ ! -z $tmp ] && echo $tmp | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard", + "externalpipe", NULL }; + +static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL }; + /* Internal keyboard shortcuts. */ #define MODKEY Mod1Mask -#define TERMMOD (ControlMask|ShiftMask) +#define TERMMOD (MODKEY|ShiftMask) static Shortcut shortcuts[] = { /* mask keysym function argument */ @@ -206,9 +215,9 @@ static Shortcut shortcuts[] = { { TERMMOD, XK_Prior, zoom, {.f = +1} }, { TERMMOD, XK_Next, zoom, {.f = -1} }, { TERMMOD, XK_Home, zoomreset, {.f = 0} }, - { TERMMOD, XK_C, clipcopy, {.i = 0} }, - { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { MODKEY, XK_c, clipcopy, {.i = 0} }, + { MODKEY, XK_v, clippaste, {.i = 0} }, + { MODKEY, XK_Y, selpaste, {.i = 0} }, { ShiftMask, XK_Insert, selpaste, {.i = 0} }, { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, { MODKEY|ShiftMask, XK_F1, setpalette, {.i = 0} }, @@ -221,6 +230,9 @@ static Shortcut shortcuts[] = { { MODKEY|ShiftMask, XK_F8, setpalette, {.i = 7} }, { MODKEY|ShiftMask, XK_F9, setpalette, {.i = 8} }, { MODKEY|ShiftMask, XK_Return, newterm, {.i = 0} }, + { MODKEY, XK_semicolon, externalpipe, {.v = copyurlcmd } }, + { TERMMOD, XK_semicolon, externalpipe, {.v = openurlcmd } }, + { MODKEY, XK_o, externalpipe, {.v = copyoutput } }, }; /*