平衡点
2022/10/17
_ 普段使いの端末を rxvt-unicode から suckless simple terminal に変えた.
urxvt は軽くて良い端末なんだけれど,
- 一部のグリフが出ない: PUAにアイコン入れてると常に豆腐になる領域がある.
- コード見れば良いんだろうけれど, 気力が….
- truecolor (24bit color) 対応
- 一応 patch はあるけど….
飽きたら fallback すれば良い, ということで st - simple terminal に移行してみることに.
コンパイル時に config.h を見て機能を有効化する, という硬派(?)な作りなので, 自分好みに弄ってパッケージングしておくことに.
有効にした patch は
- 背景透過: alpha
- カーソル点滅: blinking_cursor
ぐらい. あとはフォント, 色, フォントズームのキーマップかな.
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Sat, 15 Oct 2022 09:49:43 +0900
Subject: My custom
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
config.def.h | 61 +++++++++++++++++++++++++++++-------------------------------
1 file changed, 29 insertions(+), 32 deletions(-)
--- a/config.def.h
+++ b/config.def.h
@@ -5,8 +5,8 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
-static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
-static int borderpx = 2;
+static char *font = "Monospace:size=13:antialias=true:autohint=true";
+static int borderpx = 0.5;
/*
* What program is execed by st depends of these precedence rules:
@@ -26,7 +26,7 @@
char *vtiden = "\033[?6c";
/* Kerning / character bounding-box multipliers */
-static float cwscale = 1.0;
+static float cwscale = 0.9;
static float chscale = 1.0;
/*
@@ -94,37 +94,34 @@
unsigned int tabspaces = 8;
/* bg opacity */
-float alpha = 0.8;
+float alpha = 0.9;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
/* 8 normal colors */
- "black",
- "red3",
- "green3",
- "yellow3",
- "blue2",
- "magenta3",
- "cyan3",
- "gray90",
+ [0] = "#242424", /* black */
+ [1] = "#ff5252", /* red */
+ [2] = "#5cf19e", /* green */
+ [3] = "#ffd740", /* yellow */
+ [4] = "#4c4cff", /* blue */
+ [5] = "#ff4cff", /* magenta */
+ [6] = "#64fcda", /* cyan */
+ [7] = "#b0bec5", /* white */
/* 8 bright colors */
- "gray50",
- "red",
- "green",
- "yellow",
- "#5c5cff",
- "magenta",
- "cyan",
- "white",
+ [8] = "#4f4f4f", /* black */
+ [9] = "#ff8a80", /* red */
+ [10] = "#7fff7f", /* green */
+ [11] = "#ffe57f", /* yellow */
+ [12] = "#7f7fff", /* blue */
+ [13] = "#ff7fff", /* magenta */
+ [14] = "#a7fdeb", /* cyan */
+ [15] = "#ffffff", /* white */
+ /* special colors */
[255] = 0,
-
- /* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
- "#555555",
- "gray90", /* default foreground colour */
- "black", /* default background colour */
+ [256] = "#263238", /* background */
+ [257] = "#eceff1", /* foreground */
};
@@ -132,9 +129,9 @@
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
-unsigned int defaultfg = 258;
-unsigned int defaultbg = 259;
-unsigned int defaultcs = 256;
+unsigned int defaultfg = 257;
+unsigned int defaultbg = 256;
+unsigned int defaultcs = 10;
static unsigned int defaultrcs = 257;
/*
@@ -151,7 +148,7 @@
* 8: steady st cursor
*/
static unsigned int cursorstyle = 1;
-static Rune stcursor = 0x2603; /* snowman ("☃") */
+static Rune stcursor = 0x2B1C;
/*
* Default columns and rows numbers
@@ -163,8 +160,8 @@
/*
* Default colour and shape of the mouse cursor
*/
-static unsigned int mouseshape = XC_xterm;
-static unsigned int mousefg = 7;
+static unsigned int mouseshape = XC_left_ptr;
+static unsigned int mousefg = 15;
static unsigned int mousebg = 0;
/*
@@ -203,16 +200,20 @@
{ ControlMask, XK_Print, toggleprinter, {.i = 0} },
{ ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
- { TERMMOD, XK_Prior, zoom, {.f = +1} },
- { TERMMOD, XK_Next, zoom, {.f = -1} },
- { TERMMOD, XK_Home, zoomreset, {.f = 0} },
+ /* { TERMMOD, XK_Prior, zoom, {.f = +1} }, */
+ /* { TERMMOD, XK_Next, zoom, {.f = -1} }, */
+ /* { TERMMOD, XK_Home, zoomreset, {.f = 0} }, */
+ { TERMMOD, XK_plus, zoom, {.f = +1} },
+ { TERMMOD, XK_equal, zoom, {.f = -1} },
+ { TERMMOD, XK_asciitilde, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ /* { TERMMOD, XK_Y, selpaste, {.i = 0} }, */
+ /* { ShiftMask, XK_Insert, selpaste, {.i = 0} }, */
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
};
+
/*
* Special keys (change & recompile st.info accordingly)
*
しばし悩んだのは
フォントズームのキーマップ変更.
Ctrl+Shit+<+-0> で変更したかったのだけれど,
Shift が入ってるので XK_0
や XK_minus
じゃないって所かな.
これはキーマップで変わりそうなので xev
あたりで都度確認・変更しないと駄目かも.
というわけで,
- フォントに入っているグリフがそのまま表示されて
- truecolor に対応して
- 余計な事をしない
端末環境を手に入れる事ができました, ということで.