Keep custom version of st and update to 0.7

1c71afcdb0554d6783b3f86bcd1c9195cd394dd7
Alexis Sellier committed ago 1 parent b0f95b96
.st/PKGBUILD added +39 -0
1 +
# Contributor: Patrick Jackson <PatrickSJackson gmail com>
2 +
# Maintainer: Christoph Vigano <mail@cvigano.de>
3 +
4 +
pkgname=st
5 +
pkgver=0.7
6 +
pkgrel=0
7 +
pkgdesc='A simple virtual terminal emulator for X.'
8 +
arch=('i686' 'x86_64')
9 +
license=('MIT')
10 +
depends=('libxft' 'libxext' 'xorg-fonts-misc')
11 +
makedepends=('ncurses')
12 +
url="http://st.suckless.org"
13 +
source=(http://dl.suckless.org/st/$pkgname-$pkgver.tar.gz
14 +
       config.h
15 +
       st-scrollback-20160727-308bfbf.diff)
16 +
17 +
md5sums=('29b2a599cf1511c8062ed8f025c84c63'
18 +
         '4e1c7c6c9829e72719365a8cd30bddd4'
19 +
         'c55076d94247e121a1a86d32a793cf2e')
20 +
21 +
prepare() {
22 +
  cd $srcdir/$pkgname-$pkgver
23 +
  # skip terminfo which conflicts with ncurses
24 +
  sed -i '/\@tic /d' Makefile
25 +
  cp $srcdir/config.h config.h
26 +
  patch -Np1 < ../st-scrollback-20160727-308bfbf.diff
27 +
}
28 +
29 +
build() {
30 +
  cd $srcdir/$pkgname-$pkgver
31 +
  make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
32 +
}
33 +
34 +
package() {
35 +
  cd $srcdir/$pkgname-$pkgver
36 +
  make PREFIX=/usr DESTDIR="$pkgdir" TERMINFO="$pkgdir/usr/share/terminfo" install
37 +
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
38 +
  install -Dm644 README "$pkgdir/usr/share/doc/$pkgname/README"
39 +
}
.st/config.h +77 -15
4 4
 * appearance
5 5
 *
6 6
 * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
7 7
 */
8 8
static char font[] = "Inconsolata:pixelsize=32:antialias=true:autohint=true:dpi=150";
9 -
static int borderpx = 10;
9 +
static int borderpx = 2;
10 +
#define histsize 4000
11 +
12 +
/*
13 +
 * What program is execed by st depends of these precedence rules:
14 +
 * 1: program passed with -e
15 +
 * 2: utmp option
16 +
 * 3: SHELL environment variable
17 +
 * 4: value of shell in /etc/passwd
18 +
 * 5: value of shell in config.h
19 +
 */
10 20
static char shell[] = "/bin/zsh";
11 21
static char *utmp = NULL;
12 -
static char stty_args[] = "stty raw -echo -iexten echonl";
22 +
static char stty_args[] = "stty raw pass8 nl -echo -iexten -cstopb 38400";
13 23
14 24
/* identification sequence returned in DA and DECID */
15 25
static char vtiden[] = "\033[?6c";
16 26
17 27
/* Kerning / character bounding-box multipliers */
28 38
/* selection timeouts (in milliseconds) */
29 39
static unsigned int doubleclicktimeout = 300;
30 40
static unsigned int tripleclicktimeout = 600;
31 41
32 42
/* alt screens */
33 -
static bool allowaltscreen = true;
43 +
static int allowaltscreen = 1;
34 44
35 45
/* frames per second st should at maximum draw to the screen */
36 46
static unsigned int xfps = 120;
37 47
static unsigned int actionfps = 30;
38 48
51 61
 * bell volume. It must be a value between -100 and 100. Use 0 for disabling
52 62
 * it
53 63
 */
54 64
static int bellvolume = 0;
55 65
56 -
/* TERM value */
66 +
/* default TERM value */
57 67
static char termname[] = "st-256color";
58 68
59 -
static unsigned int tabspaces = 4;
60 -
69 +
/*
70 +
 * spaces per tab
71 +
 *
72 +
 * When you are changing this value, don't forget to adapt the »it« value in
73 +
 * the st.info and appropriately install the st.info in the environment where
74 +
 * you use this st version.
75 +
 *
76 +
 *	it#$tabspaces,
77 +
 *
78 +
 * Secondly make sure your kernel is not expanding tabs. When running `stty
79 +
 * -a` »tab0« should appear. You can tell the terminal to not expand tabs by
80 +
 *  running following command:
81 +
 *
82 +
 *	stty tabs
83 +
 */
84 +
static unsigned int tabspaces = 8;
61 85
62 86
/* Terminal colors (16 first used in escape sequence) */
63 87
static const char *colorname[] = {
64 88
	/* 8 normal colors */
65 89
	"black",
82 106
	"white",
83 107
84 108
	[255] = 0,
85 109
86 110
	/* more colors can be added after 255 to use with DefaultXX */
87 -
	"#cccccc",
88 -
	"darkred"
111 +
	"darkred",
112 +
	"#555555"
89 113
};
90 114
91 115
92 116
/*
93 117
 * Default colors (colorname index)
94 -
 * foreground, background, cursor
118 +
 * foreground, background, cursor, reverse cursor
95 119
 */
96 120
static unsigned int defaultfg = 7;
97 121
static unsigned int defaultbg = 0;
98 -
static unsigned int defaultcs = 257;
122 +
static unsigned int defaultcs = 256;
123 +
static unsigned int defaultrcs = 257;
124 +
125 +
/*
126 +
 * Default shape of cursor
127 +
 * 2: Block ("█")
128 +
 * 4: Underline ("_")
129 +
 * 6: Bar ("|")
130 +
 * 7: Snowman ("☃")
131 +
 */
132 +
static unsigned int cursorshape = 2;
133 +
134 +
/*
135 +
 * Default colour and shape of the mouse cursor
136 +
 */
137 +
static unsigned int mouseshape = XC_xterm;
138 +
static unsigned int mousefg = 7;
139 +
static unsigned int mousebg = 0;
99 140
100 141
/*
101 142
 * Colors used, when the specific fg == defaultfg. So in reverse mode this
102 143
 * will reverse too. Another logic would only make the simple feature too
103 144
 * complex.
104 145
 */
105 146
static unsigned int defaultitalic = 11;
106 147
static unsigned int defaultunderline = 7;
107 148
108 -
/* Internal mouse shortcuts. */
109 -
/* Beware that overloading Button1 will disable the selection. */
110 -
static Mousekey mshortcuts[] = {
149 +
/*
150 +
 * Internal mouse shortcuts.
151 +
 * Beware that overloading Button1 will disable the selection.
152 +
 */
153 +
static MouseShortcut mshortcuts[] = {
111 154
	/* button               mask            string */
112 155
	{ Button4,              XK_ANY_MOD,     "\031" },
113 156
	{ Button5,              XK_ANY_MOD,     "\005" },
114 157
};
115 158
116 159
/* Internal keyboard shortcuts. */
117 160
#define MODKEY Mod1Mask
118 161
119 162
static Shortcut shortcuts[] = {
120 163
	/* mask                 keysym          function        argument */
164 +
	{ XK_ANY_MOD,           XK_Break,       sendbreak,      {.i =  0} },
121 165
	{ ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
122 166
	{ ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
123 167
	{ XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
124 168
	{ MODKEY|ShiftMask,     XK_Prior,       xzoom,          {.f = +1} },
125 169
	{ MODKEY|ShiftMask,     XK_Next,        xzoom,          {.f = -1} },
127 171
	{ ShiftMask,            XK_Insert,      selpaste,       {.i =  0} },
128 172
	{ MODKEY|ShiftMask,     XK_Insert,      clippaste,      {.i =  0} },
129 173
	{ MODKEY|ShiftMask,     XK_C,           clipcopy,       {.i =  0} },
130 174
	{ MODKEY|ShiftMask,     XK_V,           clippaste,      {.i =  0} },
131 175
	{ MODKEY,               XK_Num_Lock,    numlock,        {.i =  0} },
176 +
	{ ShiftMask,            XK_Page_Up,     kscrollup,      {.i = -1} },
177 +
	{ ShiftMask,            XK_Page_Down,   kscrolldown,    {.i = -1} },
132 178
};
133 179
134 180
/*
135 181
 * Special keys (change & recompile st.info accordingly)
136 182
 *
166 212
 * State bits to ignore when matching key or button events.  By default,
167 213
 * numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
168 214
 */
169 215
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
170 216
171 -
/* Override mouse-select while mask is active (when MODE_MOUSE is set).
217 +
/*
218 +
 * Override mouse-select while mask is active (when MODE_MOUSE is set).
172 219
 * Note that if you want to use ShiftMask with selmasks, set this to an other
173 -
 * modifier, set to 0 to not use it. */
220 +
 * modifier, set to 0 to not use it.
221 +
 */
174 222
static uint forceselmod = ShiftMask;
175 223
224 +
/*
225 +
 * This is the huge key array which defines all compatibility to the Linux
226 +
 * world. Please decide about changes wisely.
227 +
 */
176 228
static Key key[] = {
177 229
	/* keysym           mask            string      appkey appcursor crlf */
178 230
	{ XK_KP_Home,       ShiftMask,      "\033[2J",       0,   -1,    0},
179 231
	{ XK_KP_Home,       ShiftMask,      "\033[1;2H",     0,   +1,    0},
180 232
	{ XK_KP_Home,       XK_ANY_MOD,     "\033[H",        0,   -1,    0},
267 319
	{ XK_Delete,        ShiftMask,      "\033[2K",      -1,    0,    0},
268 320
	{ XK_Delete,        ShiftMask,      "\033[3;2~",    +1,    0,    0},
269 321
	{ XK_Delete,        XK_ANY_MOD,     "\033[P",       -1,    0,    0},
270 322
	{ XK_Delete,        XK_ANY_MOD,     "\033[3~",      +1,    0,    0},
271 323
	{ XK_BackSpace,     XK_NO_MOD,      "\177",          0,    0,    0},
324 +
	{ XK_BackSpace,     Mod1Mask,       "\033\177",      0,    0,    0},
272 325
	{ XK_Home,          ShiftMask,      "\033[2J",       0,   -1,    0},
273 326
	{ XK_Home,          ShiftMask,      "\033[1;2H",     0,   +1,    0},
274 327
	{ XK_Home,          XK_ANY_MOD,     "\033[H",        0,   -1,    0},
275 328
	{ XK_Home,          XK_ANY_MOD,     "\033[1~",       0,   +1,    0},
276 329
	{ XK_End,           ControlMask,    "\033[J",       -1,    0,    0},
381 434
 */
382 435
static uint selmasks[] = {
383 436
	[SEL_RECTANGULAR] = Mod1Mask,
384 437
};
385 438
439 +
/*
440 +
 * Printable characters in ASCII, used to estimate the advance width
441 +
 * of single wide characters.
442 +
 */
443 +
static char ascii_printable[] =
444 +
	" !\"#$%&'()*+,-./0123456789:;<=>?"
445 +
	"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
446 +
	"`abcdefghijklmnopqrstuvwxyz{|}~";
447 +
.st/st-scrollback-20160727-308bfbf.diff added +1 -0
1 +
config.def.h +0 -0
st.c +0 -0