From b78ca2c728b6efeed2327db3feb8b232801be83f Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 10 Sep 2021 18:14:05 -0500 Subject: config.h: Change "zoom" keys (C-+/-/=) and bind 3 externalpipe scripts --- config.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/config.h b/config.h index 090bf33..0452e84 100644 --- a/config.h +++ b/config.h @@ -241,6 +241,9 @@ static MouseShortcut mshortcuts[] = { /* Internal keyboard shortcuts. */ #define MODKEY Mod1Mask #define TERMMOD (ControlMask|ShiftMask) +static char *clipboardcmd[] = { "/bin/sh", "-c", "filter_scr | xclip -selection clipboard", "externalpipe", NULL }; +static char *nmuttlongurlcmd[] = { "/bin/sh", "-c", "filter_scr | longurl", "externalpipe", NULL }; +static char *openurlcmd[] = { "/bin/sh", "-c", "xurls | dmenu -l 10 | xargs -r open", "externalpipe", NULL }; static Shortcut shortcuts[] = { /* mask keysym function argument */ @@ -248,17 +251,20 @@ static Shortcut shortcuts[] = { { ControlMask, XK_Print, toggleprinter, {.i = 0} }, { ShiftMask, XK_Print, printscreen, {.i = 0} }, { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { TERMMOD, XK_Prior, zoom, {.f = +1} }, - { TERMMOD, XK_Next, zoom, {.f = -1} }, - { TERMMOD, XK_Home, zoomreset, {.f = 0} }, + { ControlMask, XK_equal, zoom, {.f = +1} }, + { ControlMask, XK_minus, zoom, {.f = -1} }, + { TERMMOD, XK_plus, zoomreset, {.f = 0} }, { TERMMOD, XK_C, clipcopy, {.i = 0} }, { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { TERMMOD, XK_P, selpaste, {.i = 0} }, { ShiftMask, XK_Insert, selpaste, {.i = 0} }, { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, { TERMMOD, XK_I, iso14755, {.i = 0} }, + { TERMMOD, XK_Y, externalpipe, {.v = clipboardcmd } }, + { TERMMOD, XK_U, externalpipe, {.v = openurlcmd } }, + { TERMMOD, XK_L, externalpipe, {.v = nmuttlongurlcmd } }, }; /* @@ -336,7 +342,7 @@ static Key key[] = { { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", -1, 0}, { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, @@ -404,9 +410,9 @@ static Key key[] = { { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, { XK_Delete, ShiftMask, "\033[2K", -1, 0}, { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, - { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + { XK_Delete, XK_ANY_MOD, "\033[3~", -1, 0}, { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, - { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, + { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, { XK_Home, ShiftMask, "\033[2J", 0, -1}, { XK_Home, ShiftMask, "\033[1;2H", 0, +1}, -- cgit v1.2.3 From af8c826b135b7774df516eccebf805d236fc56fe Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 10 Sep 2021 18:27:31 -0500 Subject: config.h: set tabspaces to 4, fix cursor/background color chosen, fix iso14755 command --- config.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config.h b/config.h index 0452e84..905c3b5 100644 --- a/config.h +++ b/config.h @@ -98,7 +98,7 @@ char *termname = "st-256color"; * * stty tabs */ -unsigned int tabspaces = 8; +unsigned int tabspaces = 4; /* bg opacity */ float alpha = 0.8; @@ -140,8 +140,8 @@ static const char *colorname[] = { * foreground, background, cursor, reverse cursor */ unsigned int defaultfg = 257; -unsigned int defaultbg = 256; -static unsigned int defaultcs = 258; +unsigned int defaultbg = 258; +static unsigned int defaultcs = 256; static unsigned int defaultrcs = 259; /* @@ -194,9 +194,9 @@ ResourcePref resources[] = { { "color13", STRING, &colorname[13] }, { "color14", STRING, &colorname[14] }, { "color15", STRING, &colorname[15] }, - { "background", STRING, &colorname[256] }, + { "cursorColor", STRING, &colorname[256] }, { "foreground", STRING, &colorname[257] }, - { "cursorColor", STRING, &colorname[258] }, + { "background", STRING, &colorname[258] }, { "reverseCursor",STRING, &colorname[259] }, { "termname", STRING, &termname }, { "shell", STRING, &shell }, @@ -220,7 +220,8 @@ static uint forcemousemod = ShiftMask; /* * Command used to query unicode glyphs. */ -char *iso14755_cmd = "dmenu -w \"$WINDOWID\" -p codepoint: Date: Fri, 10 Sep 2021 18:37:29 -0500 Subject: x.c: fix showing st arguments twice with st -h, and add -l --- x.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x.c b/x.c index 3334498..590e853 100644 --- a/x.c +++ b/x.c @@ -2243,11 +2243,8 @@ usage(void) { die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]" " [-n name] [-o file]\n" - " [-T title] [-t title] [-w windowid]" + " [-T title] [-t title] [-l line ] [-w windowid]" " [[-e] command [args ...]]\n" - " %s [-aiv] [-c class] [-f font] [-g geometry]" - " [-n name] [-o file]\n" - " [-T title] [-t title] [-w windowid] -l line" " [stty_args ...]\n", argv0, argv0); } -- cgit v1.2.3 From 2e7bd410921d01ea02d33037f44532b90361bbb6 Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 10 Sep 2021 18:43:07 -0500 Subject: Fix x.c (I was wrong about fix), fix st.1 --- st.1 | 2 -- x.c | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/st.1 b/st.1 index 4a98626..bf3d435 100644 --- a/st.1 +++ b/st.1 @@ -18,8 +18,6 @@ st \- simple terminal .IR title ] .RB [ \-t .IR title ] -.RB [ \-l -.IR line ] .RB [ \-w .IR windowid ] .RB [[ \-e ] diff --git a/x.c b/x.c index 590e853..3334498 100644 --- a/x.c +++ b/x.c @@ -2243,8 +2243,11 @@ usage(void) { die("usage: %s [-aiv] [-c class] [-f font] [-g geometry]" " [-n name] [-o file]\n" - " [-T title] [-t title] [-l line ] [-w windowid]" + " [-T title] [-t title] [-w windowid]" " [[-e] command [args ...]]\n" + " %s [-aiv] [-c class] [-f font] [-g geometry]" + " [-n name] [-o file]\n" + " [-T title] [-t title] [-w windowid] -l line" " [stty_args ...]\n", argv0, argv0); } -- cgit v1.2.3 From a6406c8b850a41def9caa9cc3fb2579bd2c93f4f Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 10 Sep 2021 18:55:55 -0500 Subject: st.1: fix inconsistency with source code --- st.1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/st.1 b/st.1 index bf3d435..89f24c2 100644 --- a/st.1 +++ b/st.1 @@ -140,16 +140,16 @@ Print the full screen to the Print the selection to the .I iofile. .TP -.B Ctrl-Shift-Page Up +.B Ctrl-Equals Increase font size. .TP -.B Ctrl-Shift-Page Down +.B Ctrl-Minus Decrease font size. .TP -.B Ctrl-Shift-Home +.B Ctrl-Shift-Plus Reset to default font size. .TP -.B Ctrl-Shift-y +.B Ctrl-Shift-p Paste from primary selection (middle mouse button). .TP .B Ctrl-Shift-c @@ -161,6 +161,16 @@ Paste from the clipboard selection. .B Ctrl-Shift-i Launch dmenu to enter a unicode codepoint and send the corresponding glyph to st. +.TP +.B Ctrl-Shift-y +Launch dmenu to copy line(s) of output to clipboard. +.TP +.B Ctrl-Shift-u +Launch dmenu to open URL from terminal in script. +.TP +.B Ctrl-Shift-l +Launch dmenu to copy line(s) of text from neomutt to open a single URL (split +over multiple lines by neomutt, using mw). .SH CUSTOMIZATION .B st can be customized by creating a custom config.h and (re)compiling the source -- cgit v1.2.3