mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-25 00:15:46 +01:00
now do proper pkgbuild
This commit is contained in:
parent
efad574780
commit
13c9a87a1f
18 changed files with 564 additions and 6599 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
pkg/
|
||||
src/
|
||||
st-*
|
17
LEGACY
17
LEGACY
|
@ -1,17 +0,0 @@
|
|||
A STATEMENT ON LEGACY SUPPORT
|
||||
|
||||
In the terminal world there is much cruft that comes from old and unsup‐
|
||||
ported terminals that inherit incompatible modes and escape sequences
|
||||
which noone is able to know, except when he/she comes from that time and
|
||||
developed a graphical vt100 emulator at that time.
|
||||
|
||||
One goal of st is to only support what is really needed. When you en‐
|
||||
counter a sequence which you really need, implement it. But while you
|
||||
are at it, do not add the other cruft you might encounter while sneek‐
|
||||
ing at other terminal emulators. History has bloated them and there is
|
||||
no real evidence that most of the sequences are used today.
|
||||
|
||||
|
||||
Christoph Lohmann <20h@r-36.net>
|
||||
2012-09-13T07:00:36.081271045+02:00
|
||||
|
60
Makefile
60
Makefile
|
@ -1,60 +0,0 @@
|
|||
# st - simple terminal
|
||||
# See LICENSE file for copyright and license details.
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = st.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
all: options st
|
||||
|
||||
options:
|
||||
@echo st build options:
|
||||
@echo "CFLAGS = ${CFLAGS}"
|
||||
@echo "LDFLAGS = ${LDFLAGS}"
|
||||
@echo "CC = ${CC}"
|
||||
|
||||
config.h:
|
||||
cp config.def.h config.h
|
||||
|
||||
.c.o:
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.h config.mk
|
||||
|
||||
st: ${OBJ}
|
||||
@echo CC -o $@
|
||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
@echo cleaning
|
||||
@rm -f config.h st ${OBJ} st-${VERSION}.tar.gz
|
||||
|
||||
dist: clean
|
||||
@echo creating dist tarball
|
||||
@mkdir -p st-${VERSION}
|
||||
@cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 arg.h ${SRC} st-${VERSION}
|
||||
@tar -cf st-${VERSION}.tar st-${VERSION}
|
||||
@gzip st-${VERSION}.tar
|
||||
@rm -rf st-${VERSION}
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@cp -f st ${DESTDIR}${PREFIX}/bin
|
||||
@chmod 755 ${DESTDIR}${PREFIX}/bin/st
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||
@echo Please see the README file regarding the terminfo entry of st.
|
||||
@tic -sx st.info
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/st
|
||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/st.1
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
66
PKGBUILD
Normal file
66
PKGBUILD
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Maintainer: Ryan Kes <alrayyes gmail com>
|
||||
|
||||
pkgname=st
|
||||
pkgver=0.8.1
|
||||
pkgrel=1
|
||||
pkgdesc='A simple virtual terminal emulator for X.'
|
||||
arch=('i686' 'x86_64')
|
||||
license=('MIT')
|
||||
depends=('libxft' 'libxext' 'xorg-fonts-misc')
|
||||
makedepends=('ncurses')
|
||||
url="http://st.suckless.org"
|
||||
|
||||
_patches=("https://st.suckless.org/patches/clipboard/st-clipboard-20180309-c5ba9c0.diff"
|
||||
"https://st.suckless.org/patches/scrollback/st-scrollback-0.8.diff"
|
||||
"https://st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff"
|
||||
"https://st.suckless.org/patches/vertcenter/st-vertcenter-20180320-6ac8c8a.diff"
|
||||
"https://st.suckless.org/patches/hidecursor/st-hidecursor-0.8.diff"
|
||||
"https://st.suckless.org/patches/alpha/st-alpha-20171221-0ac685f.diff"
|
||||
"https://st.suckless.org/patches/solarized/st-no_bold_colors-20170623-b331da5.diff"
|
||||
"https://st.suckless.org/patches/solarized/st-solarized-dark-20170623-b331da5.diff")
|
||||
|
||||
source=("http://dl.suckless.org/st/$pkgname-$pkgver.tar.gz"
|
||||
"config.h"
|
||||
"${_patches[@]}")
|
||||
|
||||
sha256sums=('c4fb0fe2b8d2d3bd5e72763e80a8ae05b7d44dbac8f8e3bb18ef0161c7266926'
|
||||
'184f506fdf24ed7e3c8445e8176580476e4a641522625573c9fad9a3e80fdc1e'
|
||||
'4989c03de5165234303d3929e3b60d662828972203561651aa6dc6b8f67feeb8'
|
||||
'8279d347c70bc9b36f450ba15e1fd9ff62eedf49ce9258c35d7f1cfe38cca226'
|
||||
'3fb38940cc3bad3f9cd1e2a0796ebd0e48950a07860ecf8523a5afd0cd1b5a44'
|
||||
'04e6a4696293f668260b2f54a7240e379dbfabbc209de07bd5d4d57e9f513360'
|
||||
'433cc79cffe3266660924c09be3d8209127065eba1740cb9e22bee54154c6768'
|
||||
'bc7949dfb3fb4026db4a2659e291f128ae3fbb302ad5cb9b51fb28b1eb3a5433'
|
||||
'71e1211189d9e11da93ee49388379c5f8469fcd3e1f48bb4d791ddaf161f5845'
|
||||
'2a0cdd946e420591f39f068753b2f6dab0d076b962512cb850f3ba4492ee7c1b')
|
||||
|
||||
prepare() {
|
||||
cd $srcdir/$pkgname-$pkgver
|
||||
# skip terminfo which conflicts with nsurses
|
||||
sed -i '/\@tic /d' Makefile
|
||||
|
||||
# Modify alpha patch to prevent conflicts
|
||||
sed -i '1,44d' "$srcdir/$(basename ${_patches[5]})"
|
||||
sed -i 's/size_t colornamelen/unsigned int tabspaces/g' "$srcdir/$(basename ${_patches[5]})"
|
||||
sed -i '30,44d' "$srcdir/$(basename ${_patches[5]})"
|
||||
sed -i '1,68d' "$srcdir/$(basename ${_patches[7]})"
|
||||
|
||||
for patch in "${_patches[@]}"; do
|
||||
echo "Applying patch $(basename $patch)..."
|
||||
patch -Np1 -i "$srcdir/$(basename $patch)"
|
||||
done
|
||||
|
||||
cp $srcdir/config.h config.h
|
||||
}
|
||||
|
||||
build() {
|
||||
cd $srcdir/$pkgname-$pkgver
|
||||
make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $srcdir/$pkgname-$pkgver
|
||||
make PREFIX=/usr DESTDIR="$pkgdir" TERMINFO="$pkgdir/usr/share/terminfo" install
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
install -Dm644 README "$pkgdir/usr/share/doc/$pkgname/README"
|
||||
}
|
48
arg.h
48
arg.h
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* Copy me if you can.
|
||||
* by 20h
|
||||
*/
|
||||
|
||||
#ifndef ARG_H__
|
||||
#define ARG_H__
|
||||
|
||||
extern char *argv0;
|
||||
|
||||
/* use main(int argc, char *argv[]) */
|
||||
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
|
||||
argv[0] && argv[0][0] == '-'\
|
||||
&& argv[0][1];\
|
||||
argc--, argv++) {\
|
||||
char argc_;\
|
||||
char **argv_;\
|
||||
int brk_;\
|
||||
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
|
||||
argv++;\
|
||||
argc--;\
|
||||
break;\
|
||||
}\
|
||||
for (brk_ = 0, argv[0]++, argv_ = argv;\
|
||||
argv[0][0] && !brk_;\
|
||||
argv[0]++) {\
|
||||
if (argv_ != argv)\
|
||||
break;\
|
||||
argc_ = argv[0][0];\
|
||||
switch (argc_)
|
||||
#define ARGEND }\
|
||||
}
|
||||
|
||||
#define ARGC() argc_
|
||||
|
||||
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
((x), abort(), (char *)0) :\
|
||||
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||
(&argv[0][1]) :\
|
||||
(argc--, argv++, argv[0])))
|
||||
|
||||
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
(char *)0 :\
|
||||
(brk_ = 1, (argv[0][1] != '\0')?\
|
||||
(&argv[0][1]) :\
|
||||
(argc--, argv++, argv[0])))
|
||||
|
||||
#endif
|
496
config.def.h
496
config.def.h
|
@ -1,496 +0,0 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/*
|
||||
* appearance
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
static char font[] = "mono:pixelsize=14: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
|
||||
* 3: SHELL environment variable
|
||||
* 4: value of shell in /etc/passwd
|
||||
* 5: value of shell in config.h
|
||||
*/
|
||||
static char shell[] = "/bin/sh";
|
||||
static char *utmp = NULL;
|
||||
static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400";
|
||||
|
||||
/* identification sequence returned in DA and DECID */
|
||||
static char vtiden[] = "\033[?6c";
|
||||
|
||||
/* Kerning / character bounding-box multipliers */
|
||||
static float cwscale = 1.0;
|
||||
static float chscale = 1.0;
|
||||
|
||||
/*
|
||||
* word delimiter string
|
||||
*
|
||||
* More advanced example: " `'\"()[]{}"
|
||||
*/
|
||||
static char worddelimiters[] = " ";
|
||||
|
||||
/* selection timeouts (in milliseconds) */
|
||||
static unsigned int doubleclicktimeout = 300;
|
||||
static unsigned int tripleclicktimeout = 600;
|
||||
|
||||
/* alt screens */
|
||||
static int allowaltscreen = 1;
|
||||
|
||||
/* frames per second st should at maximum draw to the screen */
|
||||
static unsigned int xfps = 120;
|
||||
static unsigned int actionfps = 30;
|
||||
|
||||
/*
|
||||
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
|
||||
* attribute.
|
||||
*/
|
||||
static unsigned int blinktimeout = 800;
|
||||
|
||||
/*
|
||||
* thickness of underline and bar cursors
|
||||
*/
|
||||
static unsigned int cursorthickness = 2;
|
||||
|
||||
/*
|
||||
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
|
||||
* it
|
||||
*/
|
||||
static int bellvolume = 0;
|
||||
|
||||
/* default TERM value */
|
||||
static char termname[] = "st-256color";
|
||||
|
||||
/*
|
||||
* spaces per tab
|
||||
*
|
||||
* When you are changing this value, don't forget to adapt the »it« value in
|
||||
* the st.info and appropriately install the st.info in the environment where
|
||||
* you use this st version.
|
||||
*
|
||||
* it#$tabspaces,
|
||||
*
|
||||
* Secondly make sure your kernel is not expanding tabs. When running `stty
|
||||
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
|
||||
* running following command:
|
||||
*
|
||||
* stty tabs
|
||||
*/
|
||||
static unsigned int tabspaces = 8;
|
||||
|
||||
/* bg opacity */
|
||||
static const int alpha = 0xdd;
|
||||
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* solarized dark */
|
||||
"#073642", /* 0: black */
|
||||
"#dc322f", /* 1: red */
|
||||
"#859900", /* 2: green */
|
||||
"#b58900", /* 3: yellow */
|
||||
"#268bd2", /* 4: blue */
|
||||
"#d33682", /* 5: magenta */
|
||||
"#2aa198", /* 6: cyan */
|
||||
"#eee8d5", /* 7: white */
|
||||
"#002b36", /* 8: brblack */
|
||||
"#cb4b16", /* 9: brred */
|
||||
"#586e75", /* 10: brgreen */
|
||||
"#657b83", /* 11: bryellow */
|
||||
"#839496", /* 12: brblue */
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#93a1a1", /* 14: brcyan */
|
||||
"#fdf6e3", /* 15: brwhite */
|
||||
"black",
|
||||
};
|
||||
|
||||
/* Terminal colors for alternate (light) palette */
|
||||
static const char *altcolorname[] = {
|
||||
/* solarized light */
|
||||
"#eee8d5", /* 0: black */
|
||||
"#dc322f", /* 1: red */
|
||||
"#859900", /* 2: green */
|
||||
"#b58900", /* 3: yellow */
|
||||
"#268bd2", /* 4: blue */
|
||||
"#d33682", /* 5: magenta */
|
||||
"#2aa198", /* 6: cyan */
|
||||
"#073642", /* 7: white */
|
||||
"#fdf6e3", /* 8: brblack */
|
||||
"#cb4b16", /* 9: brred */
|
||||
"#93a1a1", /* 10: brgreen */
|
||||
"#839496", /* 11: bryellow */
|
||||
"#657b83", /* 12: brblue */
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#586e75", /* 14: brcyan */
|
||||
"#002b36", /* 15: brwhite */
|
||||
"black",
|
||||
};
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
static unsigned int defaultfg = 12;
|
||||
static unsigned int defaultbg = 257;
|
||||
static unsigned int defaultcs = 14;
|
||||
static unsigned int defaultrcs = 15;
|
||||
|
||||
/*
|
||||
* Default shape of cursor
|
||||
* 2: Block ("█")
|
||||
* 4: Underline ("_")
|
||||
* 6: Bar ("|")
|
||||
* 7: Snowman ("☃")
|
||||
*/
|
||||
static unsigned int cursorshape = 2;
|
||||
|
||||
/*
|
||||
* Default columns and rows numbers
|
||||
*/
|
||||
|
||||
static unsigned int cols = 80;
|
||||
static unsigned int rows = 24;
|
||||
|
||||
/*
|
||||
* Default colour and shape of the mouse cursor
|
||||
*/
|
||||
static unsigned int mouseshape = XC_xterm;
|
||||
static unsigned int mousefg = 7;
|
||||
static unsigned int mousebg = 0;
|
||||
|
||||
/*
|
||||
* Color used to display font attributes when fontconfig selected a font which
|
||||
* doesn't match the ones requested.
|
||||
*/
|
||||
static unsigned int defaultattr = 11;
|
||||
|
||||
/*
|
||||
* 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" },
|
||||
};
|
||||
|
||||
static MouseKey mkeys[] = {
|
||||
/* button mask function argument */
|
||||
{ Button4, ShiftMask, kscrollup, {.i = 1} },
|
||||
{ Button5, ShiftMask, kscrolldown, {.i = 1} },
|
||||
};
|
||||
|
||||
/* Internal keyboard shortcuts. */
|
||||
#define MODKEY Mod1Mask
|
||||
|
||||
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, xzoom, {.f = +1} },
|
||||
{ MODKEY|ShiftMask, XK_Next, xzoom, {.f = -1} },
|
||||
{ MODKEY|ShiftMask, XK_Home, xzoomreset, {.f = 0} },
|
||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} },
|
||||
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} },
|
||||
{ MODKEY, XK_Control_L, iso14755, {.i = 0} },
|
||||
{ MODKEY, XK_Tab, swapcolors, {.i = 0} },
|
||||
{ ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
|
||||
{ ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
|
||||
{ MODKEY, XK_k, kscrollup, {.i = 1} },
|
||||
{ MODKEY, XK_j, kscrolldown, {.i = 1} },
|
||||
{ MODKEY, XK_u, kscrollup, {.i = -1} },
|
||||
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
|
||||
};
|
||||
|
||||
/*
|
||||
* Special keys (change & recompile st.info accordingly)
|
||||
*
|
||||
* Mask value:
|
||||
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
||||
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
||||
* appkey value:
|
||||
* * 0: no value
|
||||
* * > 0: keypad application mode enabled
|
||||
* * = 2: term.numlock = 1
|
||||
* * < 0: keypad application mode disabled
|
||||
* appcursor value:
|
||||
* * 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
|
||||
* position for a key.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
|
||||
* to be mapped below, add them to this array.
|
||||
*/
|
||||
static KeySym mappedkeys[] = { -1 };
|
||||
|
||||
/*
|
||||
* State bits to ignore when matching key or button events. By default,
|
||||
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
static Key key[] = {
|
||||
/* keysym mask string appkey appcursor crlf */
|
||||
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0},
|
||||
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1, 0},
|
||||
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
|
||||
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
|
||||
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0, 0},
|
||||
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1, 0},
|
||||
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1, 0},
|
||||
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0, 0},
|
||||
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1, 0},
|
||||
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1, 0},
|
||||
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0, 0},
|
||||
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1, 0},
|
||||
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1, 0},
|
||||
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0, 0},
|
||||
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1, 0},
|
||||
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1, 0},
|
||||
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
|
||||
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
|
||||
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0, 0},
|
||||
{ XK_KP_End, ControlMask, "\033[J", -1, 0, 0},
|
||||
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0, 0},
|
||||
{ XK_KP_End, ShiftMask, "\033[K", -1, 0, 0},
|
||||
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0, 0},
|
||||
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
|
||||
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0, 0},
|
||||
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0},
|
||||
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0, 0},
|
||||
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0, 0},
|
||||
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0, 0},
|
||||
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
|
||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
|
||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
|
||||
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0, 0},
|
||||
{ XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
|
||||
{ XK_KP_Delete, ShiftMask, "\033[2K", -1, 0, 0},
|
||||
{ XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0, 0},
|
||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
|
||||
{ XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0},
|
||||
{ XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0, 0},
|
||||
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0, 0},
|
||||
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0, 0},
|
||||
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1},
|
||||
{ XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1},
|
||||
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0, 0},
|
||||
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0, 0},
|
||||
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0, 0},
|
||||
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0, 0},
|
||||
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0, 0},
|
||||
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0, 0},
|
||||
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0, 0},
|
||||
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0, 0},
|
||||
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0, 0},
|
||||
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0, 0},
|
||||
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0, 0},
|
||||
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0, 0},
|
||||
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0, 0},
|
||||
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0, 0},
|
||||
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0, 0},
|
||||
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0, 0},
|
||||
{ XK_Up, ControlMask, "\033[1;5A", 0, 0, 0},
|
||||
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0, 0},
|
||||
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0, 0},
|
||||
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0, 0},
|
||||
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1, 0},
|
||||
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1, 0},
|
||||
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0, 0},
|
||||
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0, 0},
|
||||
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0, 0},
|
||||
{ XK_Down, ControlMask, "\033[1;5B", 0, 0, 0},
|
||||
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0, 0},
|
||||
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0, 0},
|
||||
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0, 0},
|
||||
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1, 0},
|
||||
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1, 0},
|
||||
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0, 0},
|
||||
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0, 0},
|
||||
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0, 0},
|
||||
{ XK_Left, ControlMask, "\033[1;5D", 0, 0, 0},
|
||||
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0, 0},
|
||||
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0, 0},
|
||||
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0, 0},
|
||||
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1, 0},
|
||||
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1, 0},
|
||||
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0, 0},
|
||||
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0, 0},
|
||||
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0, 0},
|
||||
{ XK_Right, ControlMask, "\033[1;5C", 0, 0, 0},
|
||||
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0, 0},
|
||||
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0, 0},
|
||||
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0, 0},
|
||||
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0},
|
||||
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0},
|
||||
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0},
|
||||
{ XK_Return, Mod1Mask, "\033\r", 0, 0, -1},
|
||||
{ XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1},
|
||||
{ XK_Return, XK_ANY_MOD, "\r", 0, 0, -1},
|
||||
{ XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1},
|
||||
{ XK_Insert, ShiftMask, "\033[4l", -1, 0, 0},
|
||||
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0, 0},
|
||||
{ XK_Insert, ControlMask, "\033[L", -1, 0, 0},
|
||||
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0, 0},
|
||||
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0, 0},
|
||||
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0, 0},
|
||||
{ XK_Delete, ControlMask, "\033[M", -1, 0, 0},
|
||||
{ XK_Delete, ControlMask, "\033[3;5~", +1, 0, 0},
|
||||
{ XK_Delete, ShiftMask, "\033[2K", -1, 0, 0},
|
||||
{ XK_Delete, ShiftMask, "\033[3;2~", +1, 0, 0},
|
||||
{ XK_Delete, XK_ANY_MOD, "\033[P", -1, 0, 0},
|
||||
{ XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0, 0},
|
||||
{ XK_BackSpace, XK_NO_MOD, "\177", 0, 0, 0},
|
||||
{ XK_BackSpace, Mod1Mask, "\033\177", 0, 0, 0},
|
||||
{ XK_Home, ShiftMask, "\033[2J", 0, -1, 0},
|
||||
{ XK_Home, ShiftMask, "\033[1;2H", 0, +1, 0},
|
||||
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1, 0},
|
||||
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1, 0},
|
||||
{ XK_End, ControlMask, "\033[J", -1, 0, 0},
|
||||
{ XK_End, ControlMask, "\033[1;5F", +1, 0, 0},
|
||||
{ XK_End, ShiftMask, "\033[K", -1, 0, 0},
|
||||
{ XK_End, ShiftMask, "\033[1;2F", +1, 0, 0},
|
||||
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0, 0},
|
||||
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0, 0},
|
||||
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0, 0},
|
||||
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0, 0},
|
||||
{ XK_Next, ControlMask, "\033[6;5~", 0, 0, 0},
|
||||
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0, 0},
|
||||
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0, 0},
|
||||
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0, 0},
|
||||
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0, 0},
|
||||
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0, 0},
|
||||
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0, 0},
|
||||
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0, 0},
|
||||
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0, 0},
|
||||
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0, 0},
|
||||
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0, 0},
|
||||
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0, 0},
|
||||
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0, 0},
|
||||
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0, 0},
|
||||
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0, 0},
|
||||
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0, 0},
|
||||
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0, 0},
|
||||
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0, 0},
|
||||
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0, 0},
|
||||
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0, 0},
|
||||
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0, 0},
|
||||
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0, 0},
|
||||
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0, 0},
|
||||
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0, 0},
|
||||
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0, 0},
|
||||
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0, 0},
|
||||
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0, 0},
|
||||
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0, 0},
|
||||
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0, 0},
|
||||
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0, 0},
|
||||
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0, 0},
|
||||
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0, 0},
|
||||
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0, 0},
|
||||
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0, 0},
|
||||
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0, 0},
|
||||
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0, 0},
|
||||
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0, 0},
|
||||
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0, 0},
|
||||
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0, 0},
|
||||
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0, 0},
|
||||
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0, 0},
|
||||
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0, 0},
|
||||
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0, 0},
|
||||
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0, 0},
|
||||
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0, 0},
|
||||
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0, 0},
|
||||
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0, 0},
|
||||
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0, 0},
|
||||
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0, 0},
|
||||
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0, 0},
|
||||
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0, 0},
|
||||
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0, 0},
|
||||
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0, 0},
|
||||
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0, 0},
|
||||
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0, 0},
|
||||
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0, 0},
|
||||
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0, 0},
|
||||
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0, 0},
|
||||
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0, 0},
|
||||
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0, 0},
|
||||
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0, 0},
|
||||
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0, 0},
|
||||
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0, 0},
|
||||
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0, 0},
|
||||
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0, 0},
|
||||
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0, 0},
|
||||
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0, 0},
|
||||
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0, 0},
|
||||
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0, 0},
|
||||
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0, 0},
|
||||
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0, 0},
|
||||
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0, 0},
|
||||
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0, 0},
|
||||
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0, 0},
|
||||
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0, 0},
|
||||
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0, 0},
|
||||
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0, 0},
|
||||
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0, 0},
|
||||
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0, 0},
|
||||
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0, 0},
|
||||
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0, 0},
|
||||
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0, 0},
|
||||
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0, 0},
|
||||
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0, 0},
|
||||
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0, 0},
|
||||
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0, 0},
|
||||
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0, 0},
|
||||
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0, 0},
|
||||
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0, 0},
|
||||
};
|
||||
|
||||
/*
|
||||
* Selection types' masks.
|
||||
* Use the same masks as usual.
|
||||
* Button1Mask is always unset, to make masks match between ButtonPress.
|
||||
* ButtonRelease and MotionNotify.
|
||||
* If no match is found, regular selection is used.
|
||||
*/
|
||||
static uint selmasks[] = {
|
||||
[SEL_RECTANGULAR] = Mod1Mask,
|
||||
};
|
||||
|
||||
/*
|
||||
* Printable characters in ASCII, used to estimate the advance width
|
||||
* of single wide characters.
|
||||
*/
|
||||
static char ascii_printable[] =
|
||||
" !\"#$%&'()*+,-./0123456789:;<=>?"
|
||||
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
|
||||
"`abcdefghijklmnopqrstuvwxyz{|}~";
|
||||
|
495
config.h
Normal file
495
config.h
Normal file
|
@ -0,0 +1,495 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/*
|
||||
* appearance
|
||||
*
|
||||
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
||||
*/
|
||||
static char *font = "mono:pixelsize=14: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
|
||||
* 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;
|
||||
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
|
||||
|
||||
/* identification sequence returned in DA and DECID */
|
||||
char *vtiden = "\033[?6c";
|
||||
|
||||
/* Kerning / character bounding-box multipliers */
|
||||
static float cwscale = 1.0;
|
||||
static float chscale = 1.0;
|
||||
|
||||
/*
|
||||
* word delimiter string
|
||||
*
|
||||
* More advanced example: " `'\"()[]{}"
|
||||
*/
|
||||
char *worddelimiters = " ";
|
||||
|
||||
/* selection timeouts (in milliseconds) */
|
||||
static unsigned int doubleclicktimeout = 300;
|
||||
static unsigned int tripleclicktimeout = 600;
|
||||
|
||||
/* alt screens */
|
||||
int allowaltscreen = 1;
|
||||
|
||||
/* frames per second st should at maximum draw to the screen */
|
||||
static unsigned int xfps = 120;
|
||||
static unsigned int actionfps = 30;
|
||||
|
||||
/*
|
||||
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
|
||||
* attribute.
|
||||
*/
|
||||
static unsigned int blinktimeout = 800;
|
||||
|
||||
/*
|
||||
* thickness of underline and bar cursors
|
||||
*/
|
||||
static unsigned int cursorthickness = 2;
|
||||
|
||||
/*
|
||||
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
|
||||
* it
|
||||
*/
|
||||
static int bellvolume = 0;
|
||||
|
||||
/* default TERM value */
|
||||
char *termname = "st-256color";
|
||||
|
||||
/*
|
||||
* spaces per tab
|
||||
*
|
||||
* When you are changing this value, don't forget to adapt the »it« value in
|
||||
* the st.info and appropriately install the st.info in the environment where
|
||||
* you use this st version.
|
||||
*
|
||||
* it#$tabspaces,
|
||||
*
|
||||
* Secondly make sure your kernel is not expanding tabs. When running `stty
|
||||
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
|
||||
* running following command:
|
||||
*
|
||||
* stty tabs
|
||||
*/
|
||||
unsigned int tabspaces = 8;
|
||||
|
||||
/* bg opacity */
|
||||
unsigned int alpha = 0xcc;
|
||||
|
||||
/* alpha */
|
||||
#define OPAQUE 0Xff
|
||||
#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
|
||||
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* solarized dark */
|
||||
"#073642", /* 0: black */
|
||||
"#dc322f", /* 1: red */
|
||||
"#859900", /* 2: green */
|
||||
"#b58900", /* 3: yellow */
|
||||
"#268bd2", /* 4: blue */
|
||||
"#d33682", /* 5: magenta */
|
||||
"#2aa198", /* 6: cyan */
|
||||
"#eee8d5", /* 7: white */
|
||||
"#002b36", /* 8: brblack */
|
||||
"#cb4b16", /* 9: brred */
|
||||
"#586e75", /* 10: brgreen */
|
||||
"#657b83", /* 11: bryellow */
|
||||
"#839496", /* 12: brblue */
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#93a1a1", /* 14: brcyan */
|
||||
"#fdf6e3", /* 15: brwhite */
|
||||
"black",
|
||||
};
|
||||
|
||||
/* Terminal colors for alternate (light) palette */
|
||||
static const char *altcolorname[] = {
|
||||
/* solarized light */
|
||||
"#eee8d5", /* 0: black */
|
||||
"#dc322f", /* 1: red */
|
||||
"#859900", /* 2: green */
|
||||
"#b58900", /* 3: yellow */
|
||||
"#268bd2", /* 4: blue */
|
||||
"#d33682", /* 5: magenta */
|
||||
"#2aa198", /* 6: cyan */
|
||||
"#073642", /* 7: white */
|
||||
"#fdf6e3", /* 8: brblack */
|
||||
"#cb4b16", /* 9: brred */
|
||||
"#93a1a1", /* 10: brgreen */
|
||||
"#839496", /* 11: bryellow */
|
||||
"#657b83", /* 12: brblue */
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#586e75", /* 14: brcyan */
|
||||
"#002b36", /* 15: brwhite */
|
||||
"black",
|
||||
};
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
unsigned int defaultfg = 12;
|
||||
unsigned int defaultbg = 257;
|
||||
static unsigned int defaultcs = 14;
|
||||
static unsigned int defaultrcs = 15;
|
||||
|
||||
/*
|
||||
* Default shape of cursor
|
||||
* 2: Block ("█")
|
||||
* 4: Underline ("_")
|
||||
* 6: Bar ("|")
|
||||
* 7: Snowman ("☃")
|
||||
*/
|
||||
static unsigned int cursorshape = 2;
|
||||
|
||||
/*
|
||||
* Default columns and rows numbers
|
||||
*/
|
||||
|
||||
static unsigned int cols = 80;
|
||||
static unsigned int rows = 24;
|
||||
|
||||
/*
|
||||
* Default colour and shape of the mouse cursor
|
||||
*/
|
||||
static unsigned int mouseshape = XC_xterm;
|
||||
static unsigned int mousefg = 7;
|
||||
static unsigned int mousebg = 0;
|
||||
|
||||
/*
|
||||
* Color used to display font attributes when fontconfig selected a font which
|
||||
* doesn't match the ones requested.
|
||||
*/
|
||||
static unsigned int defaultattr = 11;
|
||||
|
||||
/*
|
||||
* 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" },
|
||||
};
|
||||
|
||||
MouseKey mkeys[] = {
|
||||
/* button mask function argument */
|
||||
{ Button4, ShiftMask, kscrollup, {.i = 1} },
|
||||
{ Button5, ShiftMask, kscrolldown, {.i = 1} },
|
||||
};
|
||||
|
||||
/* Internal keyboard shortcuts. */
|
||||
#define MODKEY Mod1Mask
|
||||
|
||||
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|ShiftMask, XK_Home, zoomreset, {.f = 0} },
|
||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_Insert, clippaste, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_V, clippaste, {.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_k, kscrollup, {.i = 1} },
|
||||
{ MODKEY, XK_j, kscrolldown, {.i = 1} },
|
||||
{ MODKEY, XK_u, kscrollup, {.i = -1} },
|
||||
{ MODKEY, XK_d, kscrolldown, {.i = -1} },
|
||||
};
|
||||
|
||||
/*
|
||||
* Special keys (change & recompile st.info accordingly)
|
||||
*
|
||||
* Mask value:
|
||||
* * Use XK_ANY_MOD to match the key no matter modifiers state
|
||||
* * Use XK_NO_MOD to match the key alone (no modifiers)
|
||||
* appkey value:
|
||||
* * 0: no value
|
||||
* * > 0: keypad application mode enabled
|
||||
* * = 2: term.numlock = 1
|
||||
* * < 0: keypad application mode disabled
|
||||
* appcursor value:
|
||||
* * 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
|
||||
* position for a key.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
|
||||
* to be mapped below, add them to this array.
|
||||
*/
|
||||
static KeySym mappedkeys[] = { -1 };
|
||||
|
||||
/*
|
||||
* State bits to ignore when matching key or button events. By default,
|
||||
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
static Key key[] = {
|
||||
/* keysym mask string appkey appcursor */
|
||||
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
|
||||
{ XK_KP_Home, ShiftMask, "\033[1;2H", 0, +1},
|
||||
{ XK_KP_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
||||
{ XK_KP_Home, XK_ANY_MOD, "\033[1~", 0, +1},
|
||||
{ XK_KP_Up, XK_ANY_MOD, "\033Ox", +1, 0},
|
||||
{ XK_KP_Up, XK_ANY_MOD, "\033[A", 0, -1},
|
||||
{ XK_KP_Up, XK_ANY_MOD, "\033OA", 0, +1},
|
||||
{ XK_KP_Down, XK_ANY_MOD, "\033Or", +1, 0},
|
||||
{ XK_KP_Down, XK_ANY_MOD, "\033[B", 0, -1},
|
||||
{ XK_KP_Down, XK_ANY_MOD, "\033OB", 0, +1},
|
||||
{ XK_KP_Left, XK_ANY_MOD, "\033Ot", +1, 0},
|
||||
{ XK_KP_Left, XK_ANY_MOD, "\033[D", 0, -1},
|
||||
{ XK_KP_Left, XK_ANY_MOD, "\033OD", 0, +1},
|
||||
{ XK_KP_Right, XK_ANY_MOD, "\033Ov", +1, 0},
|
||||
{ XK_KP_Right, XK_ANY_MOD, "\033[C", 0, -1},
|
||||
{ XK_KP_Right, XK_ANY_MOD, "\033OC", 0, +1},
|
||||
{ XK_KP_Prior, ShiftMask, "\033[5;2~", 0, 0},
|
||||
{ XK_KP_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
|
||||
{ XK_KP_Begin, XK_ANY_MOD, "\033[E", 0, 0},
|
||||
{ XK_KP_End, ControlMask, "\033[J", -1, 0},
|
||||
{ XK_KP_End, ControlMask, "\033[1;5F", +1, 0},
|
||||
{ XK_KP_End, ShiftMask, "\033[K", -1, 0},
|
||||
{ XK_KP_End, ShiftMask, "\033[1;2F", +1, 0},
|
||||
{ XK_KP_End, XK_ANY_MOD, "\033[4~", 0, 0},
|
||||
{ XK_KP_Next, ShiftMask, "\033[6;2~", 0, 0},
|
||||
{ XK_KP_Next, XK_ANY_MOD, "\033[6~", 0, 0},
|
||||
{ XK_KP_Insert, ShiftMask, "\033[2;2~", +1, 0},
|
||||
{ XK_KP_Insert, ShiftMask, "\033[4l", -1, 0},
|
||||
{ XK_KP_Insert, ControlMask, "\033[L", -1, 0},
|
||||
{ XK_KP_Insert, ControlMask, "\033[2;5~", +1, 0},
|
||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
|
||||
{ XK_KP_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
|
||||
{ XK_KP_Delete, ControlMask, "\033[M", -1, 0},
|
||||
{ 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_Multiply, XK_ANY_MOD, "\033Oj", +2, 0},
|
||||
{ XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0},
|
||||
{ XK_KP_Enter, XK_ANY_MOD, "\033OM", +2, 0},
|
||||
{ XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0},
|
||||
{ XK_KP_Subtract, XK_ANY_MOD, "\033Om", +2, 0},
|
||||
{ XK_KP_Decimal, XK_ANY_MOD, "\033On", +2, 0},
|
||||
{ XK_KP_Divide, XK_ANY_MOD, "\033Oo", +2, 0},
|
||||
{ XK_KP_0, XK_ANY_MOD, "\033Op", +2, 0},
|
||||
{ XK_KP_1, XK_ANY_MOD, "\033Oq", +2, 0},
|
||||
{ XK_KP_2, XK_ANY_MOD, "\033Or", +2, 0},
|
||||
{ XK_KP_3, XK_ANY_MOD, "\033Os", +2, 0},
|
||||
{ XK_KP_4, XK_ANY_MOD, "\033Ot", +2, 0},
|
||||
{ XK_KP_5, XK_ANY_MOD, "\033Ou", +2, 0},
|
||||
{ XK_KP_6, XK_ANY_MOD, "\033Ov", +2, 0},
|
||||
{ XK_KP_7, XK_ANY_MOD, "\033Ow", +2, 0},
|
||||
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
|
||||
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
|
||||
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0},
|
||||
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
|
||||
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
|
||||
{ XK_Up, ControlMask, "\033[1;5A", 0, 0},
|
||||
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
|
||||
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
|
||||
{ XK_Up,ShiftMask|ControlMask|Mod1Mask,"\033[1;8A", 0, 0},
|
||||
{ XK_Up, XK_ANY_MOD, "\033[A", 0, -1},
|
||||
{ XK_Up, XK_ANY_MOD, "\033OA", 0, +1},
|
||||
{ XK_Down, ShiftMask, "\033[1;2B", 0, 0},
|
||||
{ XK_Down, Mod1Mask, "\033[1;3B", 0, 0},
|
||||
{ XK_Down, ShiftMask|Mod1Mask,"\033[1;4B", 0, 0},
|
||||
{ XK_Down, ControlMask, "\033[1;5B", 0, 0},
|
||||
{ XK_Down, ShiftMask|ControlMask,"\033[1;6B", 0, 0},
|
||||
{ XK_Down, ControlMask|Mod1Mask,"\033[1;7B", 0, 0},
|
||||
{ XK_Down,ShiftMask|ControlMask|Mod1Mask,"\033[1;8B",0, 0},
|
||||
{ XK_Down, XK_ANY_MOD, "\033[B", 0, -1},
|
||||
{ XK_Down, XK_ANY_MOD, "\033OB", 0, +1},
|
||||
{ XK_Left, ShiftMask, "\033[1;2D", 0, 0},
|
||||
{ XK_Left, Mod1Mask, "\033[1;3D", 0, 0},
|
||||
{ XK_Left, ShiftMask|Mod1Mask,"\033[1;4D", 0, 0},
|
||||
{ XK_Left, ControlMask, "\033[1;5D", 0, 0},
|
||||
{ XK_Left, ShiftMask|ControlMask,"\033[1;6D", 0, 0},
|
||||
{ XK_Left, ControlMask|Mod1Mask,"\033[1;7D", 0, 0},
|
||||
{ XK_Left,ShiftMask|ControlMask|Mod1Mask,"\033[1;8D",0, 0},
|
||||
{ XK_Left, XK_ANY_MOD, "\033[D", 0, -1},
|
||||
{ XK_Left, XK_ANY_MOD, "\033OD", 0, +1},
|
||||
{ XK_Right, ShiftMask, "\033[1;2C", 0, 0},
|
||||
{ XK_Right, Mod1Mask, "\033[1;3C", 0, 0},
|
||||
{ XK_Right, ShiftMask|Mod1Mask,"\033[1;4C", 0, 0},
|
||||
{ XK_Right, ControlMask, "\033[1;5C", 0, 0},
|
||||
{ XK_Right, ShiftMask|ControlMask,"\033[1;6C", 0, 0},
|
||||
{ XK_Right, ControlMask|Mod1Mask,"\033[1;7C", 0, 0},
|
||||
{ XK_Right,ShiftMask|ControlMask|Mod1Mask,"\033[1;8C",0, 0},
|
||||
{ XK_Right, XK_ANY_MOD, "\033[C", 0, -1},
|
||||
{ XK_Right, XK_ANY_MOD, "\033OC", 0, +1},
|
||||
{ XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0},
|
||||
{ XK_Return, Mod1Mask, "\033\r", 0, 0},
|
||||
{ XK_Return, XK_ANY_MOD, "\r", 0, 0},
|
||||
{ XK_Insert, ShiftMask, "\033[4l", -1, 0},
|
||||
{ XK_Insert, ShiftMask, "\033[2;2~", +1, 0},
|
||||
{ XK_Insert, ControlMask, "\033[L", -1, 0},
|
||||
{ XK_Insert, ControlMask, "\033[2;5~", +1, 0},
|
||||
{ XK_Insert, XK_ANY_MOD, "\033[4h", -1, 0},
|
||||
{ XK_Insert, XK_ANY_MOD, "\033[2~", +1, 0},
|
||||
{ XK_Delete, ControlMask, "\033[M", -1, 0},
|
||||
{ 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_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},
|
||||
{ XK_Home, XK_ANY_MOD, "\033[H", 0, -1},
|
||||
{ XK_Home, XK_ANY_MOD, "\033[1~", 0, +1},
|
||||
{ XK_End, ControlMask, "\033[J", -1, 0},
|
||||
{ XK_End, ControlMask, "\033[1;5F", +1, 0},
|
||||
{ XK_End, ShiftMask, "\033[K", -1, 0},
|
||||
{ XK_End, ShiftMask, "\033[1;2F", +1, 0},
|
||||
{ XK_End, XK_ANY_MOD, "\033[4~", 0, 0},
|
||||
{ XK_Prior, ControlMask, "\033[5;5~", 0, 0},
|
||||
{ XK_Prior, ShiftMask, "\033[5;2~", 0, 0},
|
||||
{ XK_Prior, XK_ANY_MOD, "\033[5~", 0, 0},
|
||||
{ XK_Next, ControlMask, "\033[6;5~", 0, 0},
|
||||
{ XK_Next, ShiftMask, "\033[6;2~", 0, 0},
|
||||
{ XK_Next, XK_ANY_MOD, "\033[6~", 0, 0},
|
||||
{ XK_F1, XK_NO_MOD, "\033OP" , 0, 0},
|
||||
{ XK_F1, /* F13 */ ShiftMask, "\033[1;2P", 0, 0},
|
||||
{ XK_F1, /* F25 */ ControlMask, "\033[1;5P", 0, 0},
|
||||
{ XK_F1, /* F37 */ Mod4Mask, "\033[1;6P", 0, 0},
|
||||
{ XK_F1, /* F49 */ Mod1Mask, "\033[1;3P", 0, 0},
|
||||
{ XK_F1, /* F61 */ Mod3Mask, "\033[1;4P", 0, 0},
|
||||
{ XK_F2, XK_NO_MOD, "\033OQ" , 0, 0},
|
||||
{ XK_F2, /* F14 */ ShiftMask, "\033[1;2Q", 0, 0},
|
||||
{ XK_F2, /* F26 */ ControlMask, "\033[1;5Q", 0, 0},
|
||||
{ XK_F2, /* F38 */ Mod4Mask, "\033[1;6Q", 0, 0},
|
||||
{ XK_F2, /* F50 */ Mod1Mask, "\033[1;3Q", 0, 0},
|
||||
{ XK_F2, /* F62 */ Mod3Mask, "\033[1;4Q", 0, 0},
|
||||
{ XK_F3, XK_NO_MOD, "\033OR" , 0, 0},
|
||||
{ XK_F3, /* F15 */ ShiftMask, "\033[1;2R", 0, 0},
|
||||
{ XK_F3, /* F27 */ ControlMask, "\033[1;5R", 0, 0},
|
||||
{ XK_F3, /* F39 */ Mod4Mask, "\033[1;6R", 0, 0},
|
||||
{ XK_F3, /* F51 */ Mod1Mask, "\033[1;3R", 0, 0},
|
||||
{ XK_F3, /* F63 */ Mod3Mask, "\033[1;4R", 0, 0},
|
||||
{ XK_F4, XK_NO_MOD, "\033OS" , 0, 0},
|
||||
{ XK_F4, /* F16 */ ShiftMask, "\033[1;2S", 0, 0},
|
||||
{ XK_F4, /* F28 */ ControlMask, "\033[1;5S", 0, 0},
|
||||
{ XK_F4, /* F40 */ Mod4Mask, "\033[1;6S", 0, 0},
|
||||
{ XK_F4, /* F52 */ Mod1Mask, "\033[1;3S", 0, 0},
|
||||
{ XK_F5, XK_NO_MOD, "\033[15~", 0, 0},
|
||||
{ XK_F5, /* F17 */ ShiftMask, "\033[15;2~", 0, 0},
|
||||
{ XK_F5, /* F29 */ ControlMask, "\033[15;5~", 0, 0},
|
||||
{ XK_F5, /* F41 */ Mod4Mask, "\033[15;6~", 0, 0},
|
||||
{ XK_F5, /* F53 */ Mod1Mask, "\033[15;3~", 0, 0},
|
||||
{ XK_F6, XK_NO_MOD, "\033[17~", 0, 0},
|
||||
{ XK_F6, /* F18 */ ShiftMask, "\033[17;2~", 0, 0},
|
||||
{ XK_F6, /* F30 */ ControlMask, "\033[17;5~", 0, 0},
|
||||
{ XK_F6, /* F42 */ Mod4Mask, "\033[17;6~", 0, 0},
|
||||
{ XK_F6, /* F54 */ Mod1Mask, "\033[17;3~", 0, 0},
|
||||
{ XK_F7, XK_NO_MOD, "\033[18~", 0, 0},
|
||||
{ XK_F7, /* F19 */ ShiftMask, "\033[18;2~", 0, 0},
|
||||
{ XK_F7, /* F31 */ ControlMask, "\033[18;5~", 0, 0},
|
||||
{ XK_F7, /* F43 */ Mod4Mask, "\033[18;6~", 0, 0},
|
||||
{ XK_F7, /* F55 */ Mod1Mask, "\033[18;3~", 0, 0},
|
||||
{ XK_F8, XK_NO_MOD, "\033[19~", 0, 0},
|
||||
{ XK_F8, /* F20 */ ShiftMask, "\033[19;2~", 0, 0},
|
||||
{ XK_F8, /* F32 */ ControlMask, "\033[19;5~", 0, 0},
|
||||
{ XK_F8, /* F44 */ Mod4Mask, "\033[19;6~", 0, 0},
|
||||
{ XK_F8, /* F56 */ Mod1Mask, "\033[19;3~", 0, 0},
|
||||
{ XK_F9, XK_NO_MOD, "\033[20~", 0, 0},
|
||||
{ XK_F9, /* F21 */ ShiftMask, "\033[20;2~", 0, 0},
|
||||
{ XK_F9, /* F33 */ ControlMask, "\033[20;5~", 0, 0},
|
||||
{ XK_F9, /* F45 */ Mod4Mask, "\033[20;6~", 0, 0},
|
||||
{ XK_F9, /* F57 */ Mod1Mask, "\033[20;3~", 0, 0},
|
||||
{ XK_F10, XK_NO_MOD, "\033[21~", 0, 0},
|
||||
{ XK_F10, /* F22 */ ShiftMask, "\033[21;2~", 0, 0},
|
||||
{ XK_F10, /* F34 */ ControlMask, "\033[21;5~", 0, 0},
|
||||
{ XK_F10, /* F46 */ Mod4Mask, "\033[21;6~", 0, 0},
|
||||
{ XK_F10, /* F58 */ Mod1Mask, "\033[21;3~", 0, 0},
|
||||
{ XK_F11, XK_NO_MOD, "\033[23~", 0, 0},
|
||||
{ XK_F11, /* F23 */ ShiftMask, "\033[23;2~", 0, 0},
|
||||
{ XK_F11, /* F35 */ ControlMask, "\033[23;5~", 0, 0},
|
||||
{ XK_F11, /* F47 */ Mod4Mask, "\033[23;6~", 0, 0},
|
||||
{ XK_F11, /* F59 */ Mod1Mask, "\033[23;3~", 0, 0},
|
||||
{ XK_F12, XK_NO_MOD, "\033[24~", 0, 0},
|
||||
{ XK_F12, /* F24 */ ShiftMask, "\033[24;2~", 0, 0},
|
||||
{ XK_F12, /* F36 */ ControlMask, "\033[24;5~", 0, 0},
|
||||
{ XK_F12, /* F48 */ Mod4Mask, "\033[24;6~", 0, 0},
|
||||
{ XK_F12, /* F60 */ Mod1Mask, "\033[24;3~", 0, 0},
|
||||
{ XK_F13, XK_NO_MOD, "\033[1;2P", 0, 0},
|
||||
{ XK_F14, XK_NO_MOD, "\033[1;2Q", 0, 0},
|
||||
{ XK_F15, XK_NO_MOD, "\033[1;2R", 0, 0},
|
||||
{ XK_F16, XK_NO_MOD, "\033[1;2S", 0, 0},
|
||||
{ XK_F17, XK_NO_MOD, "\033[15;2~", 0, 0},
|
||||
{ XK_F18, XK_NO_MOD, "\033[17;2~", 0, 0},
|
||||
{ XK_F19, XK_NO_MOD, "\033[18;2~", 0, 0},
|
||||
{ XK_F20, XK_NO_MOD, "\033[19;2~", 0, 0},
|
||||
{ XK_F21, XK_NO_MOD, "\033[20;2~", 0, 0},
|
||||
{ XK_F22, XK_NO_MOD, "\033[21;2~", 0, 0},
|
||||
{ XK_F23, XK_NO_MOD, "\033[23;2~", 0, 0},
|
||||
{ XK_F24, XK_NO_MOD, "\033[24;2~", 0, 0},
|
||||
{ XK_F25, XK_NO_MOD, "\033[1;5P", 0, 0},
|
||||
{ XK_F26, XK_NO_MOD, "\033[1;5Q", 0, 0},
|
||||
{ XK_F27, XK_NO_MOD, "\033[1;5R", 0, 0},
|
||||
{ XK_F28, XK_NO_MOD, "\033[1;5S", 0, 0},
|
||||
{ XK_F29, XK_NO_MOD, "\033[15;5~", 0, 0},
|
||||
{ XK_F30, XK_NO_MOD, "\033[17;5~", 0, 0},
|
||||
{ XK_F31, XK_NO_MOD, "\033[18;5~", 0, 0},
|
||||
{ XK_F32, XK_NO_MOD, "\033[19;5~", 0, 0},
|
||||
{ XK_F33, XK_NO_MOD, "\033[20;5~", 0, 0},
|
||||
{ XK_F34, XK_NO_MOD, "\033[21;5~", 0, 0},
|
||||
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
|
||||
};
|
||||
|
||||
/*
|
||||
* Selection types' masks.
|
||||
* Use the same masks as usual.
|
||||
* Button1Mask is always unset, to make masks match between ButtonPress.
|
||||
* ButtonRelease and MotionNotify.
|
||||
* If no match is found, regular selection is used.
|
||||
*/
|
||||
static uint selmasks[] = {
|
||||
[SEL_RECTANGULAR] = Mod1Mask,
|
||||
};
|
||||
|
||||
/*
|
||||
* Printable characters in ASCII, used to estimate the advance width
|
||||
* of single wide characters.
|
||||
*/
|
||||
static char ascii_printable[] =
|
||||
" !\"#$%&'()*+,-./0123456789:;<=>?"
|
||||
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
|
||||
"`abcdefghijklmnopqrstuvwxyz{|}~";
|
28
config.mk
28
config.mk
|
@ -1,28 +0,0 @@
|
|||
# st version
|
||||
VERSION = 0.7
|
||||
|
||||
# Customize below to fit your system
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
MANPREFIX = ${PREFIX}/share/man
|
||||
|
||||
X11INC = /usr/X11R6/include
|
||||
X11LIB = /usr/X11R6/lib
|
||||
|
||||
# includes and libs
|
||||
INCS = -I. -I/usr/include -I${X11INC} \
|
||||
`pkg-config --cflags fontconfig` \
|
||||
`pkg-config --cflags freetype2`
|
||||
LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
|
||||
`pkg-config --libs fontconfig` \
|
||||
`pkg-config --libs freetype2`
|
||||
|
||||
# flags
|
||||
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
|
||||
CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS}
|
||||
LDFLAGS += -g ${LIBS}
|
||||
|
||||
# compiler and linker
|
||||
# CC = cc
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/st.c b/st.c
|
||||
index 2594c65..ebdde9f 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -1263,6 +1263,8 @@ xsetsel(char *str, Time t)
|
||||
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
|
||||
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
|
||||
selclear(0);
|
||||
+
|
||||
+ clipcopy(NULL);
|
||||
}
|
||||
|
||||
void
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/st.c b/st.c
|
||||
index 2594c65..f6fe717 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -3719,7 +3719,7 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
|
||||
|
||||
/* Change basic system colors [0-7] to bright system colors [8-15] */
|
||||
if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
|
||||
- fg = &dc.col[base.fg + 8];
|
||||
+ fg = &dc.col[base.fg];
|
||||
|
||||
if (IS_SET(MODE_REVERSE)) {
|
||||
if (fg == &dc.col[defaultfg]) {
|
|
@ -1,341 +0,0 @@
|
|||
diff --git a/config.def.h b/config.def.h
|
||||
index a719e36..9b51988 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -178,6 +178,8 @@ static Shortcut shortcuts[] = {
|
||||
{ MODKEY|ShiftMask, XK_V, clippaste, {.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} },
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/st.c b/st.c
|
||||
index fbcd9e0..64bc208 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -61,6 +61,7 @@ char *argv0;
|
||||
#define XK_ANY_MOD UINT_MAX
|
||||
#define XK_NO_MOD 0
|
||||
#define XK_SWITCH_MOD (1<<13)
|
||||
+#define histsize 2000
|
||||
|
||||
/* macros */
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
@@ -87,6 +88,8 @@ char *argv0;
|
||||
#define TRUERED(x) (((x) & 0xff0000) >> 8)
|
||||
#define TRUEGREEN(x) (((x) & 0xff00))
|
||||
#define TRUEBLUE(x) (((x) & 0xff) << 8)
|
||||
+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \
|
||||
+ + histsize + 1) % histsize] : term.line[(y) - term.scr])
|
||||
|
||||
/* constants */
|
||||
#define ISO14755CMD "dmenu -w %lu -p codepoint: </dev/null"
|
||||
@@ -241,6 +244,9 @@ typedef struct {
|
||||
int col; /* nb col */
|
||||
Line *line; /* screen */
|
||||
Line *alt; /* alternate screen */
|
||||
+ Line hist[histsize]; /* history buffer */
|
||||
+ int histi; /* history index */
|
||||
+ int scr; /* scroll back */
|
||||
int *dirty; /* dirtyness of lines */
|
||||
XftGlyphFontSpec *specbuf; /* font spec buffer used for rendering */
|
||||
TCursor c; /* cursor */
|
||||
@@ -334,6 +340,8 @@ typedef struct {
|
||||
/* function definitions used in config.h */
|
||||
static void clipcopy(const Arg *);
|
||||
static void clippaste(const Arg *);
|
||||
+static void kscrolldown(const Arg *);
|
||||
+static void kscrollup(const Arg *);
|
||||
static void numlock(const Arg *);
|
||||
static void selpaste(const Arg *);
|
||||
static void xzoom(const Arg *);
|
||||
@@ -409,8 +417,8 @@ static void tputtab(int);
|
||||
static void tputc(Rune);
|
||||
static void treset(void);
|
||||
static void tresize(int, int);
|
||||
-static void tscrollup(int, int);
|
||||
-static void tscrolldown(int, int);
|
||||
+static void tscrollup(int, int, int);
|
||||
+static void tscrolldown(int, int, int);
|
||||
static void tsetattr(int *, int);
|
||||
static void tsetchar(Rune, Glyph *, int, int);
|
||||
static void tsetscroll(int, int);
|
||||
@@ -742,10 +750,10 @@ tlinelen(int y)
|
||||
{
|
||||
int i = term.col;
|
||||
|
||||
- if (term.line[y][i - 1].mode & ATTR_WRAP)
|
||||
+ if (TLINE(y)[i - 1].mode & ATTR_WRAP)
|
||||
return i;
|
||||
|
||||
- while (i > 0 && term.line[y][i - 1].u == ' ')
|
||||
+ while (i > 0 && TLINE(y)[i - 1].u == ' ')
|
||||
--i;
|
||||
|
||||
return i;
|
||||
@@ -807,7 +815,7 @@ selsnap(int *x, int *y, int direction)
|
||||
* Snap around if the word wraps around at the end or
|
||||
* beginning of a line.
|
||||
*/
|
||||
- prevgp = &term.line[*y][*x];
|
||||
+ prevgp = &TLINE(*y)[*x];
|
||||
prevdelim = ISDELIM(prevgp->u);
|
||||
for (;;) {
|
||||
newx = *x + direction;
|
||||
@@ -822,14 +830,14 @@ selsnap(int *x, int *y, int direction)
|
||||
yt = *y, xt = *x;
|
||||
else
|
||||
yt = newy, xt = newx;
|
||||
- if (!(term.line[yt][xt].mode & ATTR_WRAP))
|
||||
+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP))
|
||||
break;
|
||||
}
|
||||
|
||||
if (newx >= tlinelen(newy))
|
||||
break;
|
||||
|
||||
- gp = &term.line[newy][newx];
|
||||
+ gp = &TLINE(newy)[newx];
|
||||
delim = ISDELIM(gp->u);
|
||||
if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|
||||
|| (delim && gp->u != prevgp->u)))
|
||||
@@ -850,14 +858,14 @@ selsnap(int *x, int *y, int direction)
|
||||
*x = (direction < 0) ? 0 : term.col - 1;
|
||||
if (direction < 0) {
|
||||
for (; *y > 0; *y += direction) {
|
||||
- if (!(term.line[*y-1][term.col-1].mode
|
||||
+ if (!(TLINE(*y-1)[term.col-1].mode
|
||||
& ATTR_WRAP)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (direction > 0) {
|
||||
for (; *y < term.row-1; *y += direction) {
|
||||
- if (!(term.line[*y][term.col-1].mode
|
||||
+ if (!(TLINE(*y)[term.col-1].mode
|
||||
& ATTR_WRAP)) {
|
||||
break;
|
||||
}
|
||||
@@ -1023,13 +1031,13 @@ getsel(void)
|
||||
}
|
||||
|
||||
if (sel.type == SEL_RECTANGULAR) {
|
||||
- gp = &term.line[y][sel.nb.x];
|
||||
+ gp = &TLINE(y)[sel.nb.x];
|
||||
lastx = sel.ne.x;
|
||||
} else {
|
||||
- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0];
|
||||
+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0];
|
||||
lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1;
|
||||
}
|
||||
- last = &term.line[y][MIN(lastx, linelen-1)];
|
||||
+ last = &TLINE(y)[MIN(lastx, linelen-1)];
|
||||
while (last >= gp && last->u == ' ')
|
||||
--last;
|
||||
|
||||
@@ -1513,6 +1521,9 @@ ttyread(void)
|
||||
if (buflen > 0)
|
||||
memmove(buf, ptr, buflen);
|
||||
|
||||
+ if (term.scr > 0 && term.scr < histsize-1)
|
||||
+ term.scr++;
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1522,6 +1533,9 @@ ttywrite(const char *s, size_t n)
|
||||
fd_set wfd, rfd;
|
||||
ssize_t r;
|
||||
size_t lim = 256;
|
||||
+ Arg arg = (Arg) { .i = term.scr };
|
||||
+
|
||||
+ kscrolldown(&arg);
|
||||
|
||||
/*
|
||||
* Remember that we are using a pty, which might be a modem line.
|
||||
@@ -1724,13 +1738,53 @@ tswapscreen(void)
|
||||
}
|
||||
|
||||
void
|
||||
-tscrolldown(int orig, int n)
|
||||
+kscrolldown(const Arg* a)
|
||||
+{
|
||||
+ int n = a->i;
|
||||
+
|
||||
+ if (n < 0)
|
||||
+ n = term.row + n;
|
||||
+
|
||||
+ if (n > term.scr)
|
||||
+ n = term.scr;
|
||||
+
|
||||
+ if (term.scr > 0) {
|
||||
+ term.scr -= n;
|
||||
+ selscroll(0, -n);
|
||||
+ tfulldirt();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+kscrollup(const Arg* a)
|
||||
+{
|
||||
+ int n = a->i;
|
||||
+
|
||||
+ if (n < 0)
|
||||
+ n = term.row + n;
|
||||
+
|
||||
+ if (term.scr <= histsize - n) {
|
||||
+ term.scr += n;
|
||||
+ selscroll(0, n);
|
||||
+ tfulldirt();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+tscrolldown(int orig, int n, int copyhist)
|
||||
{
|
||||
int i;
|
||||
Line temp;
|
||||
|
||||
LIMIT(n, 0, term.bot-orig+1);
|
||||
|
||||
+ if (copyhist) {
|
||||
+ term.histi = (term.histi - 1 + histsize) % histsize;
|
||||
+ temp = term.hist[term.histi];
|
||||
+ term.hist[term.histi] = term.line[term.bot];
|
||||
+ term.line[term.bot] = temp;
|
||||
+ }
|
||||
+
|
||||
tsetdirt(orig, term.bot-n);
|
||||
tclearregion(0, term.bot-n+1, term.col-1, term.bot);
|
||||
|
||||
@@ -1744,13 +1798,20 @@ tscrolldown(int orig, int n)
|
||||
}
|
||||
|
||||
void
|
||||
-tscrollup(int orig, int n)
|
||||
+tscrollup(int orig, int n, int copyhist)
|
||||
{
|
||||
int i;
|
||||
Line temp;
|
||||
|
||||
LIMIT(n, 0, term.bot-orig+1);
|
||||
|
||||
+ if (copyhist) {
|
||||
+ term.histi = (term.histi + 1) % histsize;
|
||||
+ temp = term.hist[term.histi];
|
||||
+ term.hist[term.histi] = term.line[orig];
|
||||
+ term.line[orig] = temp;
|
||||
+ }
|
||||
+
|
||||
tclearregion(0, orig, term.col-1, orig+n-1);
|
||||
tsetdirt(orig+n, term.bot);
|
||||
|
||||
@@ -1799,7 +1860,7 @@ tnewline(int first_col)
|
||||
int y = term.c.y;
|
||||
|
||||
if (y == term.bot) {
|
||||
- tscrollup(term.top, 1);
|
||||
+ tscrollup(term.top, 1, 1);
|
||||
} else {
|
||||
y++;
|
||||
}
|
||||
@@ -1964,14 +2025,14 @@ void
|
||||
tinsertblankline(int n)
|
||||
{
|
||||
if (BETWEEN(term.c.y, term.top, term.bot))
|
||||
- tscrolldown(term.c.y, n);
|
||||
+ tscrolldown(term.c.y, n, 0);
|
||||
}
|
||||
|
||||
void
|
||||
tdeleteline(int n)
|
||||
{
|
||||
if (BETWEEN(term.c.y, term.top, term.bot))
|
||||
- tscrollup(term.c.y, n);
|
||||
+ tscrollup(term.c.y, n, 0);
|
||||
}
|
||||
|
||||
int32_t
|
||||
@@ -2405,11 +2466,11 @@ csihandle(void)
|
||||
break;
|
||||
case 'S': /* SU -- Scroll <n> line up */
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
- tscrollup(term.top, csiescseq.arg[0]);
|
||||
+ tscrollup(term.top, csiescseq.arg[0], 0);
|
||||
break;
|
||||
case 'T': /* SD -- Scroll <n> line down */
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
- tscrolldown(term.top, csiescseq.arg[0]);
|
||||
+ tscrolldown(term.top, csiescseq.arg[0], 0);
|
||||
break;
|
||||
case 'L': /* IL -- Insert <n> blank lines */
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
@@ -2945,7 +3006,7 @@ eschandle(uchar ascii)
|
||||
return 0;
|
||||
case 'D': /* IND -- Linefeed */
|
||||
if (term.c.y == term.bot) {
|
||||
- tscrollup(term.top, 1);
|
||||
+ tscrollup(term.top, 1, 1);
|
||||
} else {
|
||||
tmoveto(term.c.x, term.c.y+1);
|
||||
}
|
||||
@@ -2958,7 +3019,7 @@ eschandle(uchar ascii)
|
||||
break;
|
||||
case 'M': /* RI -- Reverse index */
|
||||
if (term.c.y == term.top) {
|
||||
- tscrolldown(term.top, 1);
|
||||
+ tscrolldown(term.top, 1, 1);
|
||||
} else {
|
||||
tmoveto(term.c.x, term.c.y-1);
|
||||
}
|
||||
@@ -3145,7 +3206,7 @@ check_control_code:
|
||||
void
|
||||
tresize(int col, int row)
|
||||
{
|
||||
- int i;
|
||||
+ int i, j;
|
||||
int minrow = MIN(row, term.row);
|
||||
int mincol = MIN(col, term.col);
|
||||
int *bp;
|
||||
@@ -3185,6 +3246,14 @@ tresize(int col, int row)
|
||||
term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
|
||||
term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
|
||||
|
||||
+ for (i = 0; i < histsize; i++) {
|
||||
+ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph));
|
||||
+ for (j = mincol; j < col; j++) {
|
||||
+ term.hist[i][j] = term.c.attr;
|
||||
+ term.hist[i][j].u = ' ';
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* resize each row to new width, zero-pad if needed */
|
||||
for (i = 0; i < minrow; i++) {
|
||||
term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
|
||||
@@ -4112,11 +4181,11 @@ drawregion(int x1, int y1, int x2, int y2)
|
||||
term.dirty[y] = 0;
|
||||
|
||||
specs = term.specbuf;
|
||||
- numspecs = xmakeglyphfontspecs(specs, &term.line[y][x1], x2 - x1, x1, y);
|
||||
+ numspecs = xmakeglyphfontspecs(specs, &TLINE(y)[x1], x2 - x1, x1, y);
|
||||
|
||||
i = ox = 0;
|
||||
for (x = x1; x < x2 && i < numspecs; x++) {
|
||||
- new = term.line[y][x];
|
||||
+ new = TLINE(y)[x];
|
||||
if (new.mode == ATTR_WDUMMY)
|
||||
continue;
|
||||
if (ena_sel && selected(x, y))
|
||||
@@ -4136,7 +4205,9 @@ drawregion(int x1, int y1, int x2, int y2)
|
||||
if (i > 0)
|
||||
xdrawglyphfontspecs(specs, base, i, ox, y);
|
||||
}
|
||||
- xdrawcursor();
|
||||
+
|
||||
+ if (term.scr == 0)
|
||||
+ xdrawcursor();
|
||||
}
|
||||
|
||||
void
|
|
@ -1,62 +0,0 @@
|
|||
diff --git a/config.def.h b/config.def.h
|
||||
index eae969e..34ebb44 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -152,8 +152,14 @@ static unsigned int defaultunderline = 7;
|
||||
*/
|
||||
static MouseShortcut mshortcuts[] = {
|
||||
/* button mask string */
|
||||
- { Button4, XK_ANY_MOD, "\031" },
|
||||
- { Button5, XK_ANY_MOD, "\005" },
|
||||
+ { Button4, XK_NO_MOD, "\031" },
|
||||
+ { Button5, XK_NO_MOD, "\005" },
|
||||
+};
|
||||
+
|
||||
+static MouseKey mkeys[] = {
|
||||
+ /* button mask function argument */
|
||||
+ { Button4, ShiftMask, kscrollup, {.i = 1} },
|
||||
+ { Button5, ShiftMask, kscrolldown, {.i = 1} },
|
||||
};
|
||||
|
||||
/* Internal keyboard shortcuts. */
|
||||
diff --git a/st.c b/st.c
|
||||
index 233d301..c71b6e7 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -299,6 +299,13 @@ typedef union {
|
||||
const void *v;
|
||||
} Arg;
|
||||
|
||||
+typedef struct {
|
||||
+ uint b;
|
||||
+ uint mask;
|
||||
+ void (*func)(const Arg *);
|
||||
+ const Arg arg;
|
||||
+} MouseKey;
|
||||
+
|
||||
typedef struct {
|
||||
uint mod;
|
||||
KeySym keysym;
|
||||
@@ -953,6 +960,7 @@ bpress(XEvent *e)
|
||||
{
|
||||
struct timespec now;
|
||||
MouseShortcut *ms;
|
||||
+ MouseKey *mk;
|
||||
|
||||
if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
|
||||
mousereport(e);
|
||||
@@ -967,6 +975,14 @@ bpress(XEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
+ for (mk = mkeys; mk < mkeys + LEN(mkeys); mk++) {
|
||||
+ if (e->xbutton.button == mk->b
|
||||
+ && match(mk->mask, e->xbutton.state)) {
|
||||
+ mk->func(&mk->arg);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (e->xbutton.button == Button1) {
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
diff --git a/config.def.h b/config.def.h
|
||||
index b41747f..adaa9b8 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -84,42 +84,54 @@ static unsigned int tabspaces = 8;
|
||||
|
||||
/* 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",
|
||||
-
|
||||
- [255] = 0,
|
||||
-
|
||||
- /* more colors can be added after 255 to use with DefaultXX */
|
||||
- "#cccccc",
|
||||
- "#555555",
|
||||
+ /* solarized dark */
|
||||
+ "#073642", /* 0: black */
|
||||
+ "#dc322f", /* 1: red */
|
||||
+ "#859900", /* 2: green */
|
||||
+ "#b58900", /* 3: yellow */
|
||||
+ "#268bd2", /* 4: blue */
|
||||
+ "#d33682", /* 5: magenta */
|
||||
+ "#2aa198", /* 6: cyan */
|
||||
+ "#eee8d5", /* 7: white */
|
||||
+ "#002b36", /* 8: brblack */
|
||||
+ "#cb4b16", /* 9: brred */
|
||||
+ "#586e75", /* 10: brgreen */
|
||||
+ "#657b83", /* 11: bryellow */
|
||||
+ "#839496", /* 12: brblue */
|
||||
+ "#6c71c4", /* 13: brmagenta*/
|
||||
+ "#93a1a1", /* 14: brcyan */
|
||||
+ "#fdf6e3", /* 15: brwhite */
|
||||
};
|
||||
|
||||
+/* Terminal colors for alternate (light) palette */
|
||||
+static const char *altcolorname[] = {
|
||||
+ /* solarized light */
|
||||
+ "#eee8d5", /* 0: black */
|
||||
+ "#dc322f", /* 1: red */
|
||||
+ "#859900", /* 2: green */
|
||||
+ "#b58900", /* 3: yellow */
|
||||
+ "#268bd2", /* 4: blue */
|
||||
+ "#d33682", /* 5: magenta */
|
||||
+ "#2aa198", /* 6: cyan */
|
||||
+ "#073642", /* 7: white */
|
||||
+ "#fdf6e3", /* 8: brblack */
|
||||
+ "#cb4b16", /* 9: brred */
|
||||
+ "#93a1a1", /* 10: brgreen */
|
||||
+ "#839496", /* 11: bryellow */
|
||||
+ "#657b83", /* 12: brblue */
|
||||
+ "#6c71c4", /* 13: brmagenta*/
|
||||
+ "#586e75", /* 14: brcyan */
|
||||
+ "#002b36", /* 15: brwhite */
|
||||
+};
|
||||
|
||||
/*
|
||||
* Default colors (colorname index)
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
-static unsigned int defaultfg = 7;
|
||||
-static unsigned int defaultbg = 0;
|
||||
-static unsigned int defaultcs = 256;
|
||||
-static unsigned int defaultrcs = 257;
|
||||
+static unsigned int defaultfg = 12;
|
||||
+static unsigned int defaultbg = 8;
|
||||
+static unsigned int defaultcs = 14;
|
||||
+static unsigned int defaultrcs = 15;
|
||||
|
||||
/*
|
||||
* Default shape of cursor
|
||||
@@ -172,6 +184,7 @@ static Shortcut shortcuts[] = {
|
||||
{ MODKEY|ShiftMask, XK_C, clipcopy, {.i = 0} },
|
||||
{ MODKEY|ShiftMask, XK_V, clippaste, {.i = 0} },
|
||||
{ MODKEY, XK_Num_Lock, numlock, {.i = 0} },
|
||||
+ { XK_ANY_MOD, XK_F6, swapcolors, {.i = 0} },
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/st.c b/st.c
|
||||
index 2594c65..b4a3089 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -328,6 +328,7 @@ typedef struct {
|
||||
static void clipcopy(const Arg *);
|
||||
static void clippaste(const Arg *);
|
||||
static void numlock(const Arg *);
|
||||
+static void swapcolors(const Arg *);
|
||||
static void selpaste(const Arg *);
|
||||
static void xzoom(const Arg *);
|
||||
static void xzoomabs(const Arg *);
|
||||
@@ -355,7 +356,7 @@ typedef struct {
|
||||
|
||||
/* Drawing Context */
|
||||
typedef struct {
|
||||
- Color col[MAX(LEN(colorname), 256)];
|
||||
+ Color col[MAX(MAX(LEN(colorname), LEN(altcolorname)), 256)];
|
||||
Font font, bfont, ifont, ibfont;
|
||||
GC gc;
|
||||
} DC;
|
||||
@@ -533,6 +534,8 @@ static char *opt_name = NULL;
|
||||
static char *opt_title = NULL;
|
||||
static int oldbutton = 3; /* button event on startup: 3 = release */
|
||||
|
||||
+static int usealtcolors = 0; /* 1 to use alternate palette */
|
||||
+
|
||||
static char *usedfont = NULL;
|
||||
static double usedfontsize = 0;
|
||||
static double defaultfontsize = 0;
|
||||
@@ -3148,6 +3151,11 @@ sixd_to_16bit(int x)
|
||||
return x == 0 ? 0 : 0x3737 + 0x2828 * x;
|
||||
}
|
||||
|
||||
+const char* getcolorname(int i)
|
||||
+{
|
||||
+ return (usealtcolors) ? altcolorname[i] : colorname[i];
|
||||
+}
|
||||
+
|
||||
int
|
||||
xloadcolor(int i, const char *name, Color *ncolor)
|
||||
{
|
||||
@@ -3166,7 +3174,7 @@ xloadcolor(int i, const char *name, Color *ncolor)
|
||||
return XftColorAllocValue(xw.dpy, xw.vis,
|
||||
xw.cmap, &color, ncolor);
|
||||
} else
|
||||
- name = colorname[i];
|
||||
+ name = getcolorname(i);
|
||||
}
|
||||
|
||||
return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor);
|
||||
@@ -3186,8 +3194,8 @@ xloadcols(void)
|
||||
|
||||
for (i = 0; i < LEN(dc.col); i++)
|
||||
if (!xloadcolor(i, NULL, &dc.col[i])) {
|
||||
- if (colorname[i])
|
||||
- die("Could not allocate color '%s'\n", colorname[i]);
|
||||
+ if (getcolorname(i))
|
||||
+ die("Could not allocate color '%s'\n", getcolorname(i));
|
||||
else
|
||||
die("Could not allocate color %d\n", i);
|
||||
}
|
||||
@@ -3514,13 +3522,13 @@ xinit(void)
|
||||
cursor = XCreateFontCursor(xw.dpy, mouseshape);
|
||||
XDefineCursor(xw.dpy, xw.win, cursor);
|
||||
|
||||
- if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
|
||||
+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousefg), &xmousefg) == 0) {
|
||||
xmousefg.red = 0xffff;
|
||||
xmousefg.green = 0xffff;
|
||||
xmousefg.blue = 0xffff;
|
||||
}
|
||||
|
||||
- if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
|
||||
+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousebg), &xmousebg) == 0) {
|
||||
xmousebg.red = 0x0000;
|
||||
xmousebg.green = 0x0000;
|
||||
xmousebg.blue = 0x0000;
|
||||
@@ -4074,6 +4082,14 @@ numlock(const Arg *dummy)
|
||||
term.numlock ^= 1;
|
||||
}
|
||||
|
||||
+void
|
||||
+swapcolors(const Arg *dummy)
|
||||
+{
|
||||
+ usealtcolors = !usealtcolors;
|
||||
+ xloadcols();
|
||||
+ redraw();
|
||||
+}
|
||||
+
|
||||
char*
|
||||
kmap(KeySym k, uint state)
|
||||
{
|
|
@ -1,44 +0,0 @@
|
|||
diff --git a/st.c b/st.c
|
||||
index 2594c65..7285237 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -268,6 +268,7 @@ typedef struct {
|
||||
int w, h; /* window width and height */
|
||||
int ch; /* char height */
|
||||
int cw; /* char width */
|
||||
+ int cyo; /* char y offset */
|
||||
char state; /* focus, redraw, visible */
|
||||
int cursor; /* cursor style */
|
||||
} XWindow;
|
||||
@@ -3359,6 +3360,7 @@ xloadfonts(char *fontstr, double fontsize)
|
||||
/* Setting character width and height. */
|
||||
xw.cw = ceilf(dc.font.width * cwscale);
|
||||
xw.ch = ceilf(dc.font.height * chscale);
|
||||
+ xw.cyo = ceilf(dc.font.height * (chscale - 1) / 2);
|
||||
|
||||
FcPatternDel(pattern, FC_SLANT);
|
||||
FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
|
||||
@@ -3584,7 +3586,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
|
||||
font = &dc.bfont;
|
||||
frcflags = FRC_BOLD;
|
||||
}
|
||||
- yp = winy + font->ascent;
|
||||
+ yp = winy + font->ascent + xw.cyo;
|
||||
}
|
||||
|
||||
/* Lookup character index with default font. */
|
||||
@@ -3796,12 +3798,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
|
||||
|
||||
/* Render underline and strikethrough. */
|
||||
if (base.mode & ATTR_UNDERLINE) {
|
||||
- XftDrawRect(xw.draw, fg, winx, winy + dc.font.ascent + 1,
|
||||
+ XftDrawRect(xw.draw, fg, winx, winy + xw.cyo + dc.font.ascent + 1,
|
||||
width, 1);
|
||||
}
|
||||
|
||||
if (base.mode & ATTR_STRUCK) {
|
||||
- XftDrawRect(xw.draw, fg, winx, winy + 2 * dc.font.ascent / 3,
|
||||
+ XftDrawRect(xw.draw, fg, winx, winy + xw.cyo + 2 * dc.font.ascent / 3,
|
||||
width, 1);
|
||||
}
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
--- st/config.def.h 2018-01-19 12:48:07.280548253 -0700
|
||||
+++ st-transparent/config.def.h 2018-01-19 13:15:25.443443692 -0700
|
||||
@@ -82,6 +82,9 @@
|
||||
*/
|
||||
static unsigned int tabspaces = 8;
|
||||
|
||||
+/* bg opacity */
|
||||
+static const int alpha = 0xdd;
|
||||
+
|
||||
/* Terminal colors (16 first used in escape sequence) */
|
||||
static const char *colorname[] = {
|
||||
/* solarized dark */
|
||||
@@ -101,6 +104,7 @@
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#93a1a1", /* 14: brcyan */
|
||||
"#fdf6e3", /* 15: brwhite */
|
||||
+ "black",
|
||||
};
|
||||
|
||||
/* Terminal colors for alternate (light) palette */
|
||||
@@ -122,6 +126,7 @@
|
||||
"#6c71c4", /* 13: brmagenta*/
|
||||
"#586e75", /* 14: brcyan */
|
||||
"#002b36", /* 15: brwhite */
|
||||
+ "black",
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -129,7 +134,7 @@
|
||||
* foreground, background, cursor, reverse cursor
|
||||
*/
|
||||
static unsigned int defaultfg = 12;
|
||||
-static unsigned int defaultbg = 8;
|
||||
+static unsigned int defaultbg = 257;
|
||||
static unsigned int defaultcs = 14;
|
||||
static unsigned int defaultrcs = 15;
|
||||
|
||||
--- st/config.mk 2018-01-17 23:51:03.804274540 -0700
|
||||
+++ st-transparent/config.mk 2018-01-19 12:56:45.323928617 -0700
|
||||
@@ -14,7 +14,7 @@
|
||||
INCS = -I. -I/usr/include -I${X11INC} \
|
||||
`pkg-config --cflags fontconfig` \
|
||||
`pkg-config --cflags freetype2`
|
||||
-LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \
|
||||
+LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft -lXrender\
|
||||
`pkg-config --libs fontconfig` \
|
||||
`pkg-config --libs freetype2`
|
||||
|
||||
--- st/st.c 2018-01-18 19:01:56.693663129 -0700
|
||||
+++ st-transparent/st.c 2018-01-19 13:03:28.877184002 -0700
|
||||
@@ -61,6 +61,7 @@
|
||||
#define XK_ANY_MOD UINT_MAX
|
||||
#define XK_NO_MOD 0
|
||||
#define XK_SWITCH_MOD (1<<13)
|
||||
+#define OPAQUE 0Xff
|
||||
#define histsize 2000
|
||||
|
||||
/* macros */
|
||||
@@ -83,6 +84,8 @@
|
||||
(t1.tv_nsec-t2.tv_nsec)/1E6)
|
||||
#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
|
||||
|
||||
+#define USE_ARGB (alpha != OPAQUE && opt_embed == NULL)
|
||||
+
|
||||
#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
|
||||
#define IS_TRUECOL(x) (1 << 24 & (x))
|
||||
#define TRUERED(x) (((x) & 0xff0000) >> 8)
|
||||
@@ -281,6 +284,7 @@
|
||||
int w, h; /* window width and height */
|
||||
int ch; /* char height */
|
||||
int cw; /* char width */
|
||||
+ int depth; /* bit depth */
|
||||
int cyo; /* char y offset */
|
||||
char state; /* focus, redraw, visible */
|
||||
int cursor; /* cursor style */
|
||||
@@ -3326,7 +3330,7 @@
|
||||
|
||||
XFreePixmap(xw.dpy, xw.buf);
|
||||
xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
|
||||
- DefaultDepth(xw.dpy, xw.scr));
|
||||
+ xw.depth);
|
||||
XftDrawChange(xw.draw, xw.buf);
|
||||
xclear(0, 0, xw.w, xw.h);
|
||||
}
|
||||
@@ -3385,6 +3389,14 @@
|
||||
else
|
||||
die("Could not allocate color %d\n", i);
|
||||
}
|
||||
+
|
||||
+ /* set alpha value of bg color */
|
||||
+ if (USE_ARGB) {
|
||||
+ dc.col[defaultbg].color.alpha = (0xffff * alpha) / OPAQUE; //0xcccc;
|
||||
+ dc.col[defaultbg].pixel &= 0x00111111;
|
||||
+ dc.col[defaultbg].pixel |= alpha << 24; // 0xcc000000;
|
||||
+ }
|
||||
+
|
||||
loaded = 1;
|
||||
}
|
||||
|
||||
@@ -3405,6 +3417,15 @@
|
||||
|
||||
return 0;
|
||||
}
|
||||
+void
|
||||
+xtermclear(int col1, int row1, int col2, int row2) {
|
||||
+ XftDrawRect(xw.draw,
|
||||
+ &dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg],
|
||||
+ borderpx + col1 * xw.cw,
|
||||
+ borderpx + row1 * xw.ch,
|
||||
+ (col2-col1+1) * xw.cw,
|
||||
+ (row2-row1+1) * xw.ch);
|
||||
+}
|
||||
|
||||
/*
|
||||
* Absolute coordinates.
|
||||
@@ -3677,7 +3698,38 @@
|
||||
if (!(xw.dpy = XOpenDisplay(NULL)))
|
||||
die("Can't open display\n");
|
||||
xw.scr = XDefaultScreen(xw.dpy);
|
||||
- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
|
||||
+ xw.depth = (USE_ARGB) ? 32: XDefaultDepth(xw.dpy, xw.scr);
|
||||
+ if (! USE_ARGB)
|
||||
+ xw.vis = XDefaultVisual(xw.dpy, xw.scr);
|
||||
+ else {
|
||||
+ XVisualInfo *vis;
|
||||
+ XRenderPictFormat *fmt;
|
||||
+ int nvi;
|
||||
+ int i;
|
||||
+
|
||||
+ XVisualInfo tpl = {
|
||||
+ .screen = xw.scr,
|
||||
+ .depth = 32,
|
||||
+ .class = TrueColor
|
||||
+ };
|
||||
+
|
||||
+ vis = XGetVisualInfo(xw.dpy, VisualScreenMask | VisualDepthMask | VisualClassMask, &tpl, &nvi);
|
||||
+ xw.vis = NULL;
|
||||
+ for(i = 0; i < nvi; i ++) {
|
||||
+ fmt = XRenderFindVisualFormat(xw.dpy, vis[i].visual);
|
||||
+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
|
||||
+ xw.vis = vis[i].visual;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ XFree(vis);
|
||||
+
|
||||
+ if (! xw.vis) {
|
||||
+ fprintf(stderr, "Couldn't find ARGB visual.\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* font */
|
||||
if (!FcInit())
|
||||
@@ -3687,7 +3739,10 @@
|
||||
xloadfonts(usedfont, 0);
|
||||
|
||||
/* colors */
|
||||
- xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
|
||||
+ if (! USE_ARGB)
|
||||
+ xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
|
||||
+ else
|
||||
+ xw.cmap = XCreateColormap(xw.dpy, XRootWindow(xw.dpy, xw.scr), xw.vis, None);
|
||||
xloadcols();
|
||||
|
||||
/* adjust fixed window geometry */
|
||||
@@ -3710,16 +3765,17 @@
|
||||
if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
|
||||
parent = XRootWindow(xw.dpy, xw.scr);
|
||||
xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
|
||||
- xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
|
||||
+ xw.w, xw.h, 0, xw.depth, InputOutput,
|
||||
xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
|
||||
| CWEventMask | CWColormap, &xw.attrs);
|
||||
|
||||
memset(&gcvalues, 0, sizeof(gcvalues));
|
||||
gcvalues.graphics_exposures = False;
|
||||
- dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
|
||||
+ xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.depth);
|
||||
+ dc.gc = XCreateGC(xw.dpy,
|
||||
+ (USE_ARGB)? xw.buf: parent,
|
||||
+ GCGraphicsExposures,
|
||||
&gcvalues);
|
||||
- xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
|
||||
- DefaultDepth(xw.dpy, xw.scr));
|
||||
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
|
||||
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, xw.w, xw.h);
|
||||
|
183
st.1
183
st.1
|
@ -1,183 +0,0 @@
|
|||
.TH ST 1 st\-VERSION
|
||||
.SH NAME
|
||||
st \- simple terminal
|
||||
.SH SYNOPSIS
|
||||
.B st
|
||||
.RB [ \-aiv ]
|
||||
.RB [ \-c
|
||||
.IR class ]
|
||||
.RB [ \-f
|
||||
.IR font ]
|
||||
.RB [ \-g
|
||||
.IR geometry ]
|
||||
.RB [ \-n
|
||||
.IR name ]
|
||||
.RB [ \-o
|
||||
.IR iofile ]
|
||||
.RB [ \-T
|
||||
.IR title ]
|
||||
.RB [ \-t
|
||||
.IR title ]
|
||||
.RB [ \-l
|
||||
.IR line ]
|
||||
.RB [ \-w
|
||||
.IR windowid ]
|
||||
.RB [[ \-e ]
|
||||
.IR command
|
||||
.RI [ arguments ...]]
|
||||
.PP
|
||||
.B st
|
||||
.RB [ \-aiv ]
|
||||
.RB [ \-c
|
||||
.IR class ]
|
||||
.RB [ \-f
|
||||
.IR font ]
|
||||
.RB [ \-g
|
||||
.IR geometry ]
|
||||
.RB [ \-n
|
||||
.IR name ]
|
||||
.RB [ \-o
|
||||
.IR iofile ]
|
||||
.RB [ \-T
|
||||
.IR title ]
|
||||
.RB [ \-t
|
||||
.IR title ]
|
||||
.RB [ \-w
|
||||
.IR windowid ]
|
||||
.RB \-l
|
||||
.IR line
|
||||
.RI [ stty_args ...]
|
||||
.SH DESCRIPTION
|
||||
.B st
|
||||
is a simple terminal emulator.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-a
|
||||
disable alternate screens in terminal
|
||||
.TP
|
||||
.BI \-c " class"
|
||||
defines the window class (default $TERM).
|
||||
.TP
|
||||
.BI \-f " font"
|
||||
defines the
|
||||
.I font
|
||||
to use when st is run.
|
||||
.TP
|
||||
.BI \-g " geometry"
|
||||
defines the X11 geometry string.
|
||||
The form is [=][<cols>{xX}<rows>][{+-}<xoffset>{+-}<yoffset>]. See
|
||||
.BR XParseGeometry (3)
|
||||
for further details.
|
||||
.TP
|
||||
.B \-i
|
||||
will fixate the position given with the -g option.
|
||||
.TP
|
||||
.BI \-n " name"
|
||||
defines the window instance name (default $TERM).
|
||||
.TP
|
||||
.BI \-o " iofile"
|
||||
writes all the I/O to
|
||||
.I iofile.
|
||||
This feature is useful when recording st sessions. A value of "-" means
|
||||
standard output.
|
||||
.TP
|
||||
.BI \-T " title"
|
||||
defines the window title (default 'st').
|
||||
.TP
|
||||
.BI \-t " title"
|
||||
defines the window title (default 'st').
|
||||
.TP
|
||||
.BI \-w " windowid"
|
||||
embeds st within the window identified by
|
||||
.I windowid
|
||||
.TP
|
||||
.BI \-l " line"
|
||||
use a tty
|
||||
.I line
|
||||
instead of a pseudo terminal.
|
||||
.I line
|
||||
should be a (pseudo-)serial device (e.g. /dev/ttyS0 on Linux for serial port
|
||||
0).
|
||||
When this flag is given
|
||||
remaining arguments are used as flags for
|
||||
.BR stty(1).
|
||||
By default st initializes the serial line to 8 bits, no parity, 1 stop bit
|
||||
and a 38400 baud rate. The speed is set by appending it as last argument
|
||||
(e.g. 'st -l /dev/ttyS0 115200'). Arguments before the last one are
|
||||
.BR stty(1)
|
||||
flags. If you want to set odd parity on 115200 baud use for example 'st -l
|
||||
/dev/ttyS0 parenb parodd 115200'. Set the number of bits by using for
|
||||
example 'st -l /dev/ttyS0 cs7 115200'. See
|
||||
.BR stty(1)
|
||||
for more arguments and cases.
|
||||
.TP
|
||||
.B \-v
|
||||
prints version information to stderr, then exits.
|
||||
.TP
|
||||
.BI \-e " command " [ " arguments " "... ]"
|
||||
st executes
|
||||
.I command
|
||||
instead of the shell. If this is used it
|
||||
.B must be the last option
|
||||
on the command line, as in xterm / rxvt.
|
||||
This option is only intended for compability,
|
||||
and all the remaining arguments are used as a command
|
||||
even without it.
|
||||
.SH SHORTCUTS
|
||||
.TP
|
||||
.B Break
|
||||
Send a break in the serial line.
|
||||
Break key is obtained in PC keyboards
|
||||
pressing at the same time control and pause.
|
||||
.TP
|
||||
.B Ctrl-Print Screen
|
||||
Toggle if st should print to the
|
||||
.I iofile.
|
||||
.TP
|
||||
.B Shift-Print Screen
|
||||
Print the full screen to the
|
||||
.I iofile.
|
||||
.TP
|
||||
.B Print Screen
|
||||
Print the selection to the
|
||||
.I iofile.
|
||||
.TP
|
||||
.B Alt-Shift-Page Up
|
||||
Increase font size.
|
||||
.TP
|
||||
.B Alt-Shift-Page Down
|
||||
Decrease font size.
|
||||
.TP
|
||||
.B Alt-Shift-Home
|
||||
Reset to default font size.
|
||||
.TP
|
||||
.B Shift-Insert
|
||||
Paste from primary selection (middle mouse button).
|
||||
.TP
|
||||
.B Alt-Shift-Insert
|
||||
Paste from clipboard selection.
|
||||
.TP
|
||||
.B Alt-Shift-c
|
||||
Copy the selected text to the clipboard selection.
|
||||
.TP
|
||||
.B Alt-Shift-v
|
||||
Paste from the clipboard selection.
|
||||
.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
|
||||
code. This keeps it fast, secure and simple.
|
||||
.SH AUTHORS
|
||||
See the LICENSE file for the authors.
|
||||
.SH LICENSE
|
||||
See the LICENSE file for the terms of redistribution.
|
||||
.SH SEE ALSO
|
||||
.BR tabbed (1),
|
||||
.BR utmp (1),
|
||||
.BR stty (1)
|
||||
.SH BUGS
|
||||
See the TODO file in the distribution.
|
||||
|
215
st.info
215
st.info
|
@ -1,215 +0,0 @@
|
|||
st| simpleterm,
|
||||
acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
|
||||
am,
|
||||
bce,
|
||||
bel=^G,
|
||||
blink=\E[5m,
|
||||
bold=\E[1m,
|
||||
cbt=\E[Z,
|
||||
cvvis=\E[?25h,
|
||||
civis=\E[?25l,
|
||||
clear=\E[H\E[2J,
|
||||
cnorm=\E[?12l\E[?25h,
|
||||
colors#8,
|
||||
cols#80,
|
||||
cr=^M,
|
||||
csr=\E[%i%p1%d;%p2%dr,
|
||||
cub=\E[%p1%dD,
|
||||
cub1=^H,
|
||||
cud1=^J,
|
||||
cud=\E[%p1%dB,
|
||||
cuf1=\E[C,
|
||||
cuf=\E[%p1%dC,
|
||||
cup=\E[%i%p1%d;%p2%dH,
|
||||
cuu1=\E[A,
|
||||
cuu=\E[%p1%dA,
|
||||
dch=\E[%p1%dP,
|
||||
dch1=\E[P,
|
||||
dl=\E[%p1%dM,
|
||||
dl1=\E[M,
|
||||
ech=\E[%p1%dX,
|
||||
ed=\E[J,
|
||||
el=\E[K,
|
||||
el1=\E[1K,
|
||||
enacs=\E)0,
|
||||
flash=\E[?5h$<80/>\E[?5l,
|
||||
fsl=^G,
|
||||
home=\E[H,
|
||||
hpa=\E[%i%p1%dG,
|
||||
hs,
|
||||
ht=^I,
|
||||
hts=\EH,
|
||||
ich=\E[%p1%d@,
|
||||
il1=\E[L,
|
||||
il=\E[%p1%dL,
|
||||
ind=^J,
|
||||
indn=\E[%p1%dS,
|
||||
invis=\E[8m,
|
||||
is2=\E[4l\E>\E[?1034l,
|
||||
it#8,
|
||||
kel=\E[1;2F,
|
||||
ked=\E[1;5F,
|
||||
ka1=\E[1~,
|
||||
ka3=\E[5~,
|
||||
kc1=\E[4~,
|
||||
kc3=\E[6~,
|
||||
kbs=\177,
|
||||
kcbt=\E[Z,
|
||||
kb2=\EOu,
|
||||
kcub1=\EOD,
|
||||
kcud1=\EOB,
|
||||
kcuf1=\EOC,
|
||||
kcuu1=\EOA,
|
||||
kDC=\E[3;2~,
|
||||
kent=\EOM,
|
||||
kEND=\E[1;2F,
|
||||
kIC=\E[2;2~,
|
||||
kNXT=\E[6;2~,
|
||||
kPRV=\E[5;2~,
|
||||
kHOM=\E[1;2H,
|
||||
kLFT=\E[1;2D,
|
||||
kRIT=\E[1;2C,
|
||||
kind=\E[1;2B,
|
||||
kri=\E[1;2A,
|
||||
kclr=\E[3;5~,
|
||||
kdl1=\E[3;2~,
|
||||
kdch1=\E[3~,
|
||||
kich1=\E[2~,
|
||||
kend=\E[4~,
|
||||
kf1=\EOP,
|
||||
kf2=\EOQ,
|
||||
kf3=\EOR,
|
||||
kf4=\EOS,
|
||||
kf5=\E[15~,
|
||||
kf6=\E[17~,
|
||||
kf7=\E[18~,
|
||||
kf8=\E[19~,
|
||||
kf9=\E[20~,
|
||||
kf10=\E[21~,
|
||||
kf11=\E[23~,
|
||||
kf12=\E[24~,
|
||||
kf13=\E[1;2P,
|
||||
kf14=\E[1;2Q,
|
||||
kf15=\E[1;2R,
|
||||
kf16=\E[1;2S,
|
||||
kf17=\E[15;2~,
|
||||
kf18=\E[17;2~,
|
||||
kf19=\E[18;2~,
|
||||
kf20=\E[19;2~,
|
||||
kf21=\E[20;2~,
|
||||
kf22=\E[21;2~,
|
||||
kf23=\E[23;2~,
|
||||
kf24=\E[24;2~,
|
||||
kf25=\E[1;5P,
|
||||
kf26=\E[1;5Q,
|
||||
kf27=\E[1;5R,
|
||||
kf28=\E[1;5S,
|
||||
kf29=\E[15;5~,
|
||||
kf30=\E[17;5~,
|
||||
kf31=\E[18;5~,
|
||||
kf32=\E[19;5~,
|
||||
kf33=\E[20;5~,
|
||||
kf34=\E[21;5~,
|
||||
kf35=\E[23;5~,
|
||||
kf36=\E[24;5~,
|
||||
kf37=\E[1;6P,
|
||||
kf38=\E[1;6Q,
|
||||
kf39=\E[1;6R,
|
||||
kf40=\E[1;6S,
|
||||
kf41=\E[15;6~,
|
||||
kf42=\E[17;6~,
|
||||
kf43=\E[18;6~,
|
||||
kf44=\E[19;6~,
|
||||
kf45=\E[20;6~,
|
||||
kf46=\E[21;6~,
|
||||
kf47=\E[23;6~,
|
||||
kf48=\E[24;6~,
|
||||
kf49=\E[1;3P,
|
||||
kf50=\E[1;3Q,
|
||||
kf51=\E[1;3R,
|
||||
kf52=\E[1;3S,
|
||||
kf53=\E[15;3~,
|
||||
kf54=\E[17;3~,
|
||||
kf55=\E[18;3~,
|
||||
kf56=\E[19;3~,
|
||||
kf57=\E[20;3~,
|
||||
kf58=\E[21;3~,
|
||||
kf59=\E[23;3~,
|
||||
kf60=\E[24;3~,
|
||||
kf61=\E[1;4P,
|
||||
kf62=\E[1;4Q,
|
||||
kf63=\E[1;4R,
|
||||
khome=\E[1~,
|
||||
kil1=\E[2;5~,
|
||||
krmir=\E[2;2~,
|
||||
kich1=\E[2~,
|
||||
knp=\E[6~,
|
||||
kmous=\E[M,
|
||||
kpp=\E[5~,
|
||||
lines#24,
|
||||
mir,
|
||||
msgr,
|
||||
npc,
|
||||
op=\E[39;49m,
|
||||
pairs#64,
|
||||
mc0=\E[i,
|
||||
mc4=\E[4i,
|
||||
mc5=\E[5i,
|
||||
rc=\E8,
|
||||
rev=\E[7m,
|
||||
ri=\EM,
|
||||
ritm=\E[23m,
|
||||
rmacs=\E(B,
|
||||
rmcup=\E[?1049l,
|
||||
rmir=\E[4l,
|
||||
rmkx=\E[?1l\E>,
|
||||
rmso=\E[27m,
|
||||
rmul=\E[24m,
|
||||
rs1=\Ec,
|
||||
rs2=\E[4l\E>\E[?1034l,
|
||||
sc=\E7,
|
||||
setab=\E[4%p1%dm,
|
||||
setaf=\E[3%p1%dm,
|
||||
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
|
||||
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
|
||||
sgr0=\E[0m,
|
||||
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
|
||||
sitm=\E[3m,
|
||||
smacs=\E(0,
|
||||
smcup=\E[?1049h,
|
||||
smir=\E[4h,
|
||||
smkx=\E[?1h\E=,
|
||||
smso=\E[7m,
|
||||
smul=\E[4m,
|
||||
tbc=\E[3g,
|
||||
tsl=\E]0;,
|
||||
xenl,
|
||||
vpa=\E[%i%p1%dd,
|
||||
# Tmux unofficial extensions, see TERMINFO EXTENSIONS in tmux(1)
|
||||
Se,
|
||||
Ss,
|
||||
Tc,
|
||||
|
||||
st-256color| simpleterm with 256 colors,
|
||||
use=st,
|
||||
colors#256,
|
||||
pairs#32767,
|
||||
# Nicked from xterm-256color
|
||||
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
|
||||
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
|
||||
|
||||
st-meta| simpleterm with meta key,
|
||||
use=st,
|
||||
km,
|
||||
rmm=\E[?1034l,
|
||||
smm=\E[?1034h,
|
||||
rs2=\E[4l\E>\E[?1034h,
|
||||
is2=\E[4l\E>\E[?1034h,
|
||||
|
||||
st-meta-256color| simpleterm with meta key and 256 colors,
|
||||
use=st-256color,
|
||||
km,
|
||||
rmm=\E[?1034l,
|
||||
smm=\E[?1034h,
|
||||
rs2=\E[4l\E>\E[?1034h,
|
||||
is2=\E[4l\E>\E[?1034h,
|
Loading…
Reference in a new issue