Skip to content

Commit

Permalink
0.8.4 update, scroll added as separate prog
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeSmithxyz committed Feb 6, 2021
1 parent 73c034b commit fa3c401
Show file tree
Hide file tree
Showing 15 changed files with 494 additions and 586 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
st
patches/
.gitignore
*.o
pkg/
*.pkg.tar.xz
patches
st
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "scroll"]
path = scroll
url = https://github.com/lukesmithxyz/scroll.git
3 changes: 1 addition & 2 deletions FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
github: lukesmithxyz
custom: ["https://lukesmith.xyz/donate", "https://paypal.me/lukemsmith", "https://lukesmith.xyz/crypto"]
patreon: lukesmith
custom: ["https://lukesmith.xyz/donate", "https://lukesmith.xyz/crypto"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT/X Consortium License

© 2014-2018 Hiltjo Posthuma <hiltjo at codemadness dot org>
© 2014-2020 Hiltjo Posthuma <hiltjo at codemadness dot org>
© 2018 Devin J. Pohly <djpohly at gmail dot com>
© 2014-2017 Quentin Rameau <quinq at fifth dot space>
© 2009-2012 Aurélien APTEL <aurelien dot aptel at gmail dot com>
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ options:
@echo "LDFLAGS = $(STLDFLAGS)"
@echo "CC = $(CC)"

config.h:
cp config.def.h config.h

.c.o:
$(CC) $(STCFLAGS) -c $<

Expand All @@ -32,17 +29,20 @@ st: $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)

clean:
rm -f st $(OBJ) st-$(VERSION).tar.gz *.o *.orig *.rej
rm -f st $(OBJ) st-$(VERSION).tar.gz *.rej *.orig *.o

dist: clean
mkdir -p st-$(VERSION)
cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
config.h st.info st.1 arg.h st.h win.h $(SRC)\
st-$(VERSION)
tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
rm -rf st-$(VERSION)

install: st
git submodule init
git submodule update
$(MAKE) install -C scroll
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f st $(DESTDIR)$(PREFIX)/bin
cp -f st-copyout $(DESTDIR)$(PREFIX)/bin
Expand All @@ -62,4 +62,4 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st-urlhandler
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1

.PHONY: all options clean dist install uninstall
.PHONY: all options clean dist scroll install uninstall
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The [suckless terminal (st)](https://st.suckless.org/) with some additional feat

## Bindings for

+ **scrollback** with `alt-↑/↓` or `alt-pageup/down` or `shift` while scrolling the mouse
+ scroll with `alt-↑/↓` or `alt-pageup/down` or `shift` while scrolling the mouse ([scroll](https://github.com/lukesmithxyz/scroll) must be installed)
+ OR **vim-bindings**: scroll up/down in history with `alt-k` and `alt-j`. Faster with `alt-u`/`alt-d`.
+ **zoom/change font size**: same bindings as above, but holding down shift as well. `alt-home` returns to default
+ **copy text** with `alt-c`, **paste** is `alt-v` or `shift-insert`
Expand All @@ -24,10 +24,10 @@ The [suckless terminal (st)](https://st.suckless.org/) with some additional feat

## Other st patches

+ Vertcenter
+ Scrollback
+ Boxdraw
+ Ligatures
+ font2
+ updated to latest version 0.8.2
+ updated to latest version 0.8.4

## Installation for newbs

Expand Down
79 changes: 31 additions & 48 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char *font = "mono:pixelsize=14:antialias=true:autohint=true";
static char *font = "mono:pixelsize=12:antialias=true:autohint=true";
static char *font2[] = { "JoyPixels:pixelsize=10:antialias=true:autohint=true" };
static int borderpx = 2;

/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: utmp option
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */
char *scroll = "scroll";
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";

/* identification sequence returned in DA and DECID */
Expand All @@ -42,6 +44,10 @@ static unsigned int tripleclicktimeout = 600;
/* alt screens */
int allowaltscreen = 1;

/* allow certain non-interactive (insecure) window operations such as:
setting the clipboard text */
int allowwindowops = 0;

/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
Expand All @@ -57,13 +63,6 @@ static double maxlatency = 33;
*/
static unsigned int blinktimeout = 800;

/*
* interval (in milliseconds) between each successive call to ximspot. This
* improves terminal performance while not reducing functionality to those
* whom need XIM support.
*/
int ximspot_update_interval = 1000;

/*
* thickness of underline and bar cursors
*/
Expand All @@ -76,10 +75,10 @@ static unsigned int cursorthickness = 2;
* 0: disable (render all U25XX glyphs normally from the font).
*/
const int boxdraw = 1;
const int boxdraw_bold = 1;
const int boxdraw_bold = 0;

/* braille (U28XX): 1: render as adjacent "pixels", 0: use font */
const int boxdraw_braille = 1;
const int boxdraw_braille = 0;

/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
Expand Down Expand Up @@ -175,6 +174,13 @@ static unsigned int mousebg = 0;
*/
static unsigned int defaultattr = 11;

/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask;

/*
* Xresources preferences to load at startup
*/
Expand Down Expand Up @@ -202,42 +208,39 @@ ResourcePref resources[] = {
{ "cursorColor", STRING, &colorname[256] },
{ "termname", STRING, &termname },
{ "shell", STRING, &shell },
{ "minlatency", INTEGER, &minlatency },
{ "maxlatency", INTEGER, &maxlatency },
{ "blinktimeout", INTEGER, &blinktimeout },
{ "bellvolume", INTEGER, &bellvolume },
{ "tabspaces", INTEGER, &tabspaces },
{ "borderpx", INTEGER, &borderpx },
{ "cwscale", FLOAT, &cwscale },
{ "chscale", FLOAT, &chscale },
{ "alpha", FLOAT, &alpha },
{ "ximspot_update_interval", INTEGER, &ximspot_update_interval },
};

/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = {
/* button mask string */
{ Button4, XK_NO_MOD, "\031" },
{ Button5, XK_NO_MOD, "\005" },
/* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
{ XK_ANY_MOD, Button5, ttysend, {.s = "\005"} },
};

/* Internal keyboard shortcuts. */
#define MODKEY Mod1Mask
#define TERMMOD (Mod1Mask|ShiftMask)

MouseKey mkeys[] = {
/* button mask function argument */
{ Button4, XK_NO_MOD, kscrollup, {.i = 1} },
{ Button5, XK_NO_MOD, kscrolldown, {.i = 1} },
{ Button4, TERMMOD, zoom, {.f = +1} },
{ Button5, TERMMOD, zoom, {.f = -1} },
};

static char *openurlcmd[] = { "/bin/sh", "-c", "st-urlhandler -o", "externalpipe", NULL };
static char *copyurlcmd[] = { "/bin/sh", "-c", "st-urlhandler -c", "externalpipe", NULL };
static char *copyoutput[] = { "/bin/sh", "-c", "st-copyout", "externalpipe", NULL };


static Shortcut shortcuts[] = {
/* mask keysym function argument */
{ XK_ANY_MOD, XK_Break, sendbreak, {.i = 0} },
Expand All @@ -246,23 +249,14 @@ static Shortcut shortcuts[] = {
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ TERMMOD, XK_Prior, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} },
{ MODKEY, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
{ MODKEY, XK_c, clipcopy, {.i = 0} },
{ ShiftMask, XK_Insert, clippaste, {.i = 0} },
{ MODKEY, XK_v, clippaste, {.i = 0} },
{ XK_ANY_MOD, Button2, 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} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
{ MODKEY, XK_s, changealpha, {.f = -0.05} },
{ MODKEY, XK_a, changealpha, {.f = +0.05} },
{ TERMMOD, XK_Up, zoom, {.f = +1} },
Expand Down Expand Up @@ -291,10 +285,6 @@ static Shortcut shortcuts[] = {
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
* crlf value
* * 0: no value
* * > 0: crlf mode is enabled
* * < 0: crlf mode is disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
Expand All @@ -313,13 +303,6 @@ static KeySym mappedkeys[] = { -1 };
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;

/*
* Override mouse-select while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forceselmod = ShiftMask;

/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
Expand Down
12 changes: 4 additions & 8 deletions config.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# st version
VERSION = 0.8.2
VERSION = 0.8.4

# Customize below to fit your system

# paths
PREFIX ?= /usr/local
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# include X11 in Ubuntu
# X11INC = /usr/include/X11R6
# X11LIB = /usr/lib/X11R6

PKG_CONFIG = pkg-config

# includes and libs
Expand All @@ -34,8 +30,8 @@ STLDFLAGS = $(LIBS) $(LDFLAGS)
# OpenBSD:
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
# `pkg-config --libs fontconfig` \
# `pkg-config --libs freetype2`
# `$(PKG_CONFIG) --libs fontconfig` \
# `$(PKG_CONFIG) --libs freetype2`

# compiler and linker
# CC = c99
1 change: 1 addition & 0 deletions scroll
Submodule scroll added at 210539
10 changes: 3 additions & 7 deletions st.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.TH ST 1 st\-VERSION
.SH NAME
st \- simple terminal (Luke Smith (https://lukesmith.xyz)'s build)
st \- simple terminal
.SH SYNOPSIS
.B st
.RB [ \-aiv ]
Expand Down Expand Up @@ -176,10 +176,6 @@ Print the full screen to the
.B Print Screen
Print the selection to the
.I iofile.
.TP
.B Alt-Ctrl
Launch dmenu to enter a unicode codepoint and send the corresponding glyph
to st.
.SH CUSTOMIZATION
.B st
can be customized by creating a custom config.h and (re)compiling the source
Expand All @@ -191,7 +187,7 @@ See the LICENSE file for the terms of redistribution.
.SH SEE ALSO
.BR tabbed (1),
.BR utmp (1),
.BR stty (1)
.BR stty (1),
.BR scroll (1)
.SH BUGS
See the TODO file in the distribution.

Loading

0 comments on commit fa3c401

Please sign in to comment.