summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2021-09-23 00:19:22 -0500
committerzachir <zachir@librem.one>2021-09-23 00:19:22 -0500
commitbb3c7c159c128ef88e59bfb17488a4e82a790721 (patch)
tree15e12b7434e4a6c38a98a250f84ce691f38d9ae7
parenta25ab0d3ef1ef99acc2821b8edd433844e59eb66 (diff)
parenta6406c8b850a41def9caa9cc3fb2579bd2c93f4f (diff)
Merge my earlier st with some new fixes
Merge branch 'master' of gitlab.com:zachir/st
-rw-r--r--config.h27
-rw-r--r--st.120
2 files changed, 31 insertions, 16 deletions
diff --git a/config.h b/config.h
index 01c7f9d..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: </dev/null";
+/* char *iso14755_cmd = "dmenu -w \"$WINDOWID\" -p codepoint: </dev/null"; */
+char *iso14755_cmd = "dmenu -p codepoint: </dev/null";
/*
* Internal mouse shortcuts.
@@ -241,6 +242,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 +252,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 } },
};
/*
diff --git a/st.1 b/st.1
index 4a98626..89f24c2 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 ]
@@ -142,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
@@ -163,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