diff --git a/README.md b/README.md index 0cd9318..748f81e 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,30 @@ -# Luke's build of st - the simple (suckless) terminal +# Rasmus's build of st + +This is based on Lukes ST fork + +- Added extra key combinations for zoom and copy paste +- Copy/Paste shift + ctrl + c/v + +## Luke's additions The [suckless terminal (st)](https://st.suckless.org/) with some additional features: -+ Compatibility with `Xresources` and `pywal` for dynamic colors. -+ Default [gruvbox](https://github.com/morhetz/gruvbox) colors otherwise. -+ Transparency/alpha, which is also adjustable from `~/.Xresources`. -+ Default font is system "mono" at 16pt, meaning the font will match your system font. -+ Very useful keybinds including: - + Copy is alt-c, paste is alt-v or alt-p pastes from primary selection - + Alt-l feeds all urls on screen to dmenu, so they user can choose and - follow one (requires xurls and dmenu installed). - + Zoom in/out or increase font size with Alt+Shift+k/j or u/d for larger intervals. - + Hold alt and press either ↑/↓ or the vim keys k/j to move up/down in the terminal. - + Shift+Mouse wheel do the same. - + Alt-u and Alt-d scroll back/forward in history a page at a time. - + Alt-PageUp and Alt-PageDown will do the same. -+ Vertcenter -+ Scrollback -+ updated to latest version 0.8.1 +- Compatibility with `Xresources` and `pywal` for dynamic colors. +- Default [gruvbox](https://github.com/morhetz/gruvbox) colors otherwise. +- Transparency/alpha, which is also adjustable from `~/.Xresources`. +- Default font is system "mono" at 16pt, meaning the font will match your system font. +- Very useful keybinds including: + Copy is alt-c, paste is alt-v or alt-p pastes from primary selection + Alt-l feeds all urls on screen to dmenu, so they user can choose and + follow one (requires xurls and dmenu installed). + Zoom in/out or increase font size with Alt+Shift+k/j or u/d for larger intervals. + Hold alt and press either ↑/↓ or the vim keys k/j to move up/down in the termgit@github.com:RasmusKoit/st.gitinal. + Shift+Mouse wheel do the same. + Alt-u and Alt-d scroll back/forward in history a page at a time. + Alt-PageUp and Alt-PageDown will do the same. +- Vertcenter +- Scrollback +- updated to latest version 0.8.1 The following additional bindings were added before I forked this: -+ Scroll through history -- Shift+PageUp/PageDown or Shift+Mouse wheel -+ Increase/decrease font size -- Shift+Alt+PageUp/PageDown -+ Return to default font size -- Alt+Home -+ Paste -- Shift+Insert +- Scroll through history -- Shift+PageUp/PageDown or Shift+Mouse wheel +- Increase/decrease font size -- Shift+Alt+PageUp/PageDown +- Return to default font size -- Alt+Home +- Paste -- Shift+Insert ## Installation for newbs @@ -33,12 +33,22 @@ make sudo make install ``` -Obviously, `make` is required to build. `fontconfig` is required for the default build, since it asks `fontconfig` for your system monospace font. It might be obvious, but `libX11` and `libXft` are required as well. Chances are, you have all of this installed already. +Obviously, `make` is required to build. `fontconfig` is required for the default build, since it asks `fontconfig` for your system monospace font. It might be obvious, but `libX11` and `libXft` are required as well. Chances are, you have all of this installed already. On OpenBSD, be sure to edit `config.mk` first and remove `-lrt` from the `$LIBS` before compiling. Be sure to have a composite manager (`xcompmgr`, `compton`, etc.) running if you want transparency. +## How to get link dmenu to work + +Get the latest [xurls](https://github.com/mvdan/xurls/releases/latest) +Download binary and save it to `/usr/local/bin/` + +``` +wget -O xurls https://github.com/mvdan/xurls/releases/download/v2.0.0/xurls_v2.0.0_darwin_amd64 +sudo mv xurls /usr/local/bin/xurls +``` + ## How to configure dynamically with Xresources For many key variables, this build of `st` will look for X settings set in either `~/.Xdefaults` or `~/.Xresources`. You must run `xrdb` on one of these files to load the settings. @@ -65,7 +75,8 @@ To be clear about the color settings: Note that when you run `wal`, it will negate the transparency of existing windows, but new windows will continue with the previously defined transparency. -## Contact +## Special thanks to - Luke Smith - [https://lukesmith.xyz](https://lukesmith.xyz) +- Suckless diff --git a/config.h b/config.h index 53ce8fb..8c9687d 100644 --- a/config.h +++ b/config.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "mono:pixelsize=16:antialias=true:autohint=true"; +static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; static int borderpx = 2; /* @@ -16,7 +16,7 @@ static int borderpx = 2; * 4: value of shell in /etc/passwd * 5: value of shell in config.h */ -static char *shell = "/bin/sh"; +static char *shell = "/bin/zsh"; char *utmp = NULL; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; @@ -210,37 +210,43 @@ static char *openurlcmd[] = { "/bin/sh", "-c", "externalpipe", NULL }; static Shortcut shortcuts[] = { - /* mask keysym function argument */ - { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, - { ControlMask, XK_Print, toggleprinter, {.i = 0} }, - { ShiftMask, XK_Print, printscreen, {.i = 0} }, - { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { MODKEY|ShiftMask, XK_Prior, zoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_Next, zoom, {.f = -1} }, - { MODKEY, XK_Home, zoomreset, {.f = 0} }, - { ShiftMask, XK_Insert, clippaste, {.i = 0} }, - { MODKEY, XK_c, clipcopy, {.i = 0} }, - { MODKEY, XK_v, clippaste, {.i = 0} }, - { MODKEY, XK_p, selpaste, {.i = 0} }, - { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, - { MODKEY, XK_Control_L, iso14755, {.i = 0} }, - { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, - { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, - { MODKEY, XK_Page_Up, kscrollup, {.i = -1} }, - { MODKEY, XK_Page_Down, kscrolldown, {.i = -1} }, - { MODKEY, XK_k, kscrollup, {.i = 1} }, - { MODKEY, XK_j, kscrolldown, {.i = 1} }, - { MODKEY, XK_Up, kscrollup, {.i = 1} }, - { MODKEY, XK_Down, kscrolldown, {.i = 1} }, - { MODKEY, XK_u, kscrollup, {.i = -1} }, - { MODKEY, XK_d, kscrolldown, {.i = -1} }, - { MODKEY|ShiftMask, XK_Up, zoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_Down, zoom, {.f = -1} }, - { MODKEY|ShiftMask, XK_K, zoom, {.f = +1} }, - { MODKEY|ShiftMask, XK_J, zoom, {.f = -1} }, - { MODKEY|ShiftMask, XK_U, zoom, {.f = +2} }, - { MODKEY|ShiftMask, XK_D, zoom, {.f = -2} }, - { MODKEY, XK_l, externalpipe, { .v = openurlcmd } }, + /* mask keysym function argument */ + { XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} }, + { ControlMask, XK_Print, toggleprinter, {.i = 0} }, + { ShiftMask, XK_Print, printscreen, {.i = 0} }, + { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, + { MODKEY|ShiftMask, XK_Prior, zoom, {.f = +1} }, + { MODKEY|ShiftMask, XK_Next, zoom, {.f = -1} }, + { MODKEY, XK_Home, zoomreset, {.f = 0} }, + { ControlMask, XK_equal, zoom, {.f = +1} }, + { ControlMask, XK_minus, zoom, {.f = -1} }, + { ControlMask, XK_0, zoomreset, {.f = 0} }, + { ControlMask, XK_KP_Add, zoom, {.f = +1} }, + { ControlMask, XK_KP_Subtract, zoom, {.f = -1} }, + { ControlMask, XK_KP_0, zoomreset, {.f = 0} }, + { ShiftMask, XK_KP_Insert, clippaste, {.i = 0} }, + { ControlMask|ShiftMask, XK_C, clipcopy, {.i = 0} }, + { ControlMask|ShiftMask, XK_V, clippaste, {.i = 0} }, + { ShiftMask, XK_V, selpaste, {.i = 0} }, + { MODKEY, XK_Num_Lock, numlock, {.i = 0} }, + { MODKEY, XK_Control_L, iso14755, {.i = 0} }, + { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} }, + { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} }, + { MODKEY, XK_Page_Up, kscrollup, {.i = -1} }, + { MODKEY, XK_Page_Down, kscrolldown, {.i = -1} }, + { MODKEY, XK_k, kscrollup, {.i = 1} }, + { MODKEY, XK_j, kscrolldown, {.i = 1} }, + { MODKEY, XK_Up, kscrollup, {.i = 1} }, + { MODKEY, XK_Down, kscrolldown, {.i = 1} }, + { MODKEY, XK_u, kscrollup, {.i = -1} }, + { MODKEY, XK_d, kscrolldown, {.i = -1} }, + { MODKEY|ShiftMask, XK_Up, zoom, {.f = +1} }, + { MODKEY|ShiftMask, XK_Down, zoom, {.f = -1} }, + { MODKEY|ShiftMask, XK_K, zoom, {.f = +1} }, + { MODKEY|ShiftMask, XK_J, zoom, {.f = -1} }, + { MODKEY|ShiftMask, XK_U, zoom, {.f = +2} }, + { MODKEY|ShiftMask, XK_D, zoom, {.f = -2} }, + { MODKEY, XK_l, externalpipe, { .v = openurlcmd } }, }; /* diff --git a/config.mk b/config.mk index 3b00d7e..1e4ae7a 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.8.1 +VERSION = 0.8.2 # Customize below to fit your system diff --git a/st.1 b/st.1 index efa32ee..0ec21fd 100644 --- a/st.1 +++ b/st.1 @@ -1,6 +1,6 @@ .TH ST 1 st\-VERSION .SH NAME -st \- simple terminal (Luke Smith (https://lukesmith.xyz)'s build) +st \- simple terminal (Rasmus Koit's build) .SH SYNOPSIS .B st .RB [ \-aiv ] @@ -137,10 +137,10 @@ Increase or decrease font size. .B Alt-Home Reset to default font size. .TP -.B Shift-Insert or Alt-v +.B Shift-Insert or Alt-v or Shift-ctrl-v Paste from clipboard. .TP -.B Alt-c +.B Alt-c or Shift-Ctrl-c Copy to clipboard. .TP .B Alt-p