nageyqma·git
HTTPS https://git.nageyqma.icu/nageyqma/st.git SSH git@git.nageyqma.icu:nageyqma/st.git

HTTPS 链接可直接 git clone;推送代码请使用 SSH。

2.5 KB · 74 行raw
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
st - simple terminal
--------------------
st is a simple terminal emulator for Wayland which sucks less.

It is a port of suckless st: the terminal core (st.c) is unchanged, the
old X11 backend has been replaced by a small Wayland backend (wl.c) that
draws an ARGB8888 wl_shm buffer.  There is no X11 code path and no
XWayland fallback.


Requirements
------------
In order to build st you need:

  - wayland-client and wayland-protocols (wayland-scanner)
  - xkbcommon
  - fontconfig and freetype2
  - harfbuzz

The protocol bindings are generated at build time and are not committed.
The XMLs are found through pkg-config, then under $XDG_DATA_HOME (or
~/.local/share), /usr/local/share and /usr/share.  If wayland-protocols
lives somewhere else, point WLPROTO at it:

    make WLPROTO=/opt/wayland-protocols


Installation
------------
Edit config.mk to match your local setup (st is installed into
the /usr/local namespace by default).

Afterwards enter the following command to build and install st (if
necessary as root):

    make clean install


Running st
----------
st runs on any Wayland compositor that implements xdg-shell and wl_shm.
The following protocols are used when the compositor provides them and
silently skipped otherwise: fractional-scale/viewporter for crisp
fractional scaling, text-input-v3 for input methods, primary-selection,
cursor-shape and xdg-system-bell.

If you did not install st with make clean install, you must compile
the st terminfo entry with the following command:

    tic -sx st.info

See the man page for additional details.

Notes
-----
- Wayland does not let clients place their windows.  -g only selects the
  initial number of columns and rows; offsets are ignored with a warning.
- -n and -w are gone: X11 instance names and XEmbed do not exist here.
- Scaling: the surface is rendered at the compositor's preferred scale and
  mapped through wp_viewport, so 1.5x and other fractional scales stay
  crisp.
- The window is drawn with two rotating buffers; every commit contains the
  complete frame.  This is required because some compositors (KWin) keep
  the current buffer alive until it is replaced and therefore never send
  wl_buffer.release for a single-buffer scheme.
- Font fallback: a glyph the configured font does not carry (CJK, for
  instance) is drawn with the first fontconfig candidate whose face really
  contains it.  The family in config.h stays the primary font; fallback only
  fills the gaps.

Credits
-------
Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.