mirror of
https://github.com/tiyn/st
synced 2025-10-14 03:51:15 +02:00
Compare commits
10 Commits
cb84a5ff99
...
config
Author | SHA1 | Date | |
---|---|---|---|
ea17e8482c | |||
5a9bb12e32 | |||
85b0517a66 | |||
3ec0bd40b0 | |||
c89bbcf33d | |||
2ede01a088 | |||
5491457642 | |||
bf7eebfb7d | |||
bb3d4dba10 | |||
7c08bf621b |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -50,3 +50,5 @@ modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
st
|
||||
|
9
Makefile
9
Makefile
@@ -4,7 +4,7 @@
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = st.c x.c
|
||||
SRC = st.c x.c hb.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
all: options st
|
||||
@@ -22,7 +22,8 @@ config.h:
|
||||
$(CC) $(STCFLAGS) -c $<
|
||||
|
||||
st.o: config.h st.h win.h
|
||||
x.o: arg.h config.h st.h win.h
|
||||
x.o: arg.h config.h st.h win.h hb.h
|
||||
hb.o: st.h
|
||||
|
||||
$(OBJ): config.h config.mk
|
||||
|
||||
@@ -43,7 +44,9 @@ dist: clean
|
||||
install: st
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f st $(DESTDIR)$(PREFIX)/bin
|
||||
cp -f st-copyout $(DESTDIR)$(PREFIX)/bin
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
|
||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/st-copyout
|
||||
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
||||
sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
|
||||
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
|
||||
@@ -52,6 +55,8 @@ install: st
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/st
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/st-copyout
|
||||
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
||||
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
||||
|
34
README
34
README
@@ -1,34 +0,0 @@
|
||||
st - simple terminal
|
||||
--------------------
|
||||
st is a simple terminal emulator for X which sucks less.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
In order to build st you need the Xlib header files.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
Edit config.mk to match your local setup (st is installed into
|
||||
the /usr/local namespace by default).
|
||||
|
||||
Afterwards enter the following command to build and install st (if
|
||||
necessary as root):
|
||||
|
||||
make clean install
|
||||
|
||||
|
||||
Running st
|
||||
----------
|
||||
If you did not install st with make clean install, you must compile
|
||||
the st terminfo entry with the following command:
|
||||
|
||||
tic -sx st.info
|
||||
|
||||
See the man page for additional details.
|
||||
|
||||
Credits
|
||||
-------
|
||||
Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.
|
||||
|
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# st
|
||||
|
||||
This is my patched version of st. The base version is directly from suckless.org.
|
||||
This belongs to my larbs installation script, but does not directly depend on it.
|
||||
It is supposed to work in the environment after the larbs-base-installation.
|
||||
|
||||
## Patches
|
||||
|
||||
The list below shows the currently applied patches to the master branch.
|
||||
|
||||
- st-alpha-20220206-0.8.5.diff (adds transparency)
|
||||
- st-anysize-20220718-baa9357.diff (st leaves no gaps if the height/width doesn't match a multiple of
|
||||
character height)
|
||||
- st-externalpipe-0.8.4.diff (allows reading and writing st's screen through a pipe)
|
||||
- st-ligatures-scrollback-20230105-0.9.diff (scrollback compatible addition of ligatures)
|
||||
- st-scrollback-0.8.5.diff (add scrollback functionality)
|
||||
|
||||
## Hotkeys
|
||||
|
||||
There are various shortcuts and hotkeys used in this version. Included in my build are the following.
|
||||
|
||||
| ModKey | Shift | Key | Function |
|
||||
| ------ | ----- | --------------- | -------------------------------------------- |
|
||||
| Alt | | Break | Send break |
|
||||
| Alt | | Print | Toggle printer |
|
||||
| Alt | | Print | Print screen |
|
||||
| | Shift | Insert | Clipboard paste |
|
||||
| Alt | | c | Clipboard copy |
|
||||
| Alt | | v | Clipboard paste |
|
||||
| Alt | | p | Selected paste |
|
||||
| Alt | | NumLock | Toggle Numlock |
|
||||
| Alt | | k | Scroll up |
|
||||
| Alt | | j | Scroll down |
|
||||
| | | MouseScrollUp | Scroll up |
|
||||
| | | MouseScrollDown | Scroll down |
|
||||
| Alt | Shift | u | Zoom in |
|
||||
| Alt | Shift | i | Zoom out |
|
||||
| Alt | | o | copy output of previous command to clipboard |
|
||||
|
||||
## Installation
|
||||
|
||||
The most basic way is to clone the repository and then invoke make.
|
||||
|
||||
- `git clone https://github.com/tiyn/st`
|
||||
- `make clean install`
|
95
config.def.h
95
config.def.h
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
|
||||
static char *font = "mono:pixelsize=16:antialias=true:autohint=true";
|
||||
static int borderpx = 2;
|
||||
|
||||
/*
|
||||
@@ -93,35 +93,33 @@ char *termname = "st-256color";
|
||||
*/
|
||||
unsigned int tabspaces = 8;
|
||||
|
||||
/* bg opacity */
|
||||
float alpha = 1.0;
|
||||
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* 8 normal colors */
|
||||
"black",
|
||||
"red3",
|
||||
"green3",
|
||||
"yellow3",
|
||||
"blue2",
|
||||
"magenta3",
|
||||
"cyan3",
|
||||
"gray90",
|
||||
|
||||
/* 8 bright colors */
|
||||
"gray50",
|
||||
"red",
|
||||
"green",
|
||||
"yellow",
|
||||
"#5c5cff",
|
||||
"magenta",
|
||||
"cyan",
|
||||
"white",
|
||||
|
||||
"#191919",
|
||||
"#f44747",
|
||||
"#608b4e",
|
||||
"#dcdcaa",
|
||||
"#569cd6",
|
||||
"#c678dd",
|
||||
"#56b6c2",
|
||||
"#d4d4d4",
|
||||
"#808080",
|
||||
"#f44747",
|
||||
"#608b4e",
|
||||
"#dcdcaa",
|
||||
"#569cd6",
|
||||
"#c678dd",
|
||||
"#56b6c2",
|
||||
"#d4d4d4",
|
||||
[255] = 0,
|
||||
|
||||
/* more colors can be added after 255 to use with DefaultXX */
|
||||
"#cccccc",
|
||||
"#555555",
|
||||
"gray90", /* default foreground colour */
|
||||
"black", /* default background colour */
|
||||
"#191919", /* 256 -> bg */
|
||||
"#d4d4d4", /* 257 -> fg */
|
||||
"#a4a4a4", /* 258 -> cursor */
|
||||
};
|
||||
|
||||
|
||||
@@ -129,10 +127,10 @@ static const char *colorname[] = {
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
unsigned int defaultfg = 258;
|
||||
unsigned int defaultbg = 259;
|
||||
unsigned int defaultcs = 256;
|
||||
static unsigned int defaultrcs = 257;
|
||||
unsigned int defaultfg = 257;
|
||||
unsigned int defaultbg = 256;
|
||||
unsigned int defaultcs = 258;
|
||||
static unsigned int defaultrcs = 0;
|
||||
|
||||
/*
|
||||
* Default shape of cursor
|
||||
@@ -175,32 +173,35 @@ static uint forcemousemod = ShiftMask;
|
||||
* Beware that overloading Button1 will disable the selection.
|
||||
*/
|
||||
static MouseShortcut mshortcuts[] = {
|
||||
/* 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"} },
|
||||
/* mask button function argument release */
|
||||
{ Button4, XK_NO_MOD, "\031" },
|
||||
{ Button5, XK_NO_MOD, "\005" },
|
||||
{ XK_NO_MOD, Button4, kscrollup, {.i = 1} },
|
||||
{ XK_NO_MOD, Button5, kscrolldown,{.i = 1} },
|
||||
};
|
||||
|
||||
/* Internal keyboard shortcuts. */
|
||||
#define MODKEY Mod1Mask
|
||||
#define TERMMOD (ControlMask|ShiftMask)
|
||||
|
||||
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} },
|
||||
{ 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} },
|
||||
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
|
||||
{ TERMMOD, XK_V, clippaste, {.i = 0} },
|
||||
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
|
||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
||||
{ MODKEY, XK_Break, sendbreak, {.i = 0} },
|
||||
{ MODKEY, XK_Print, toggleprinter, {.i = 0} },
|
||||
{ MODKEY, XK_Print, printscreen, {.i = 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_k, kscrollup, {.i = 1} },
|
||||
{ MODKEY, XK_j, kscrolldown, {.i = 1} },
|
||||
{ MODKEY, XK_U, zoom, {.f = +1} },
|
||||
{ MODKEY|ShiftMask, XK_U, zoom, {.f = +1} },
|
||||
{ MODKEY|ShiftMask, XK_I, zoom, {.f = -1} },
|
||||
{ MODKEY, XK_o, externalpipe, {.v = copyoutput } },
|
||||
};
|
||||
|
||||
/*
|
||||
|
13
st-copyout
Normal file
13
st-copyout
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Using external pipe with st, give a dmenu prompt of recent commands,
|
||||
# allowing the user to copy the output of one.
|
||||
# xclip required for this script.
|
||||
# By Jaywalker and Luke
|
||||
tmpfile=$(mktemp /tmp/st-cmd-output.XXXXXX)
|
||||
trap 'rm "$tmpfile"' 0 1 15
|
||||
sed -n "w $tmpfile"
|
||||
sed -i 's/\x0//g' "$tmpfile"
|
||||
ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^\s*//' | cut -d' ' -f1)"
|
||||
chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')"
|
||||
eps1="$(echo "$ps1" | sed 's/[^^]/[&]/g; s/\^/\\^/g')"
|
||||
awk "/^$chosen$/{p=1;print;next} p&&/$eps1/{p=0};p" "$tmpfile" | xclip -selection clipboard
|
Reference in New Issue
Block a user