Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

My build of the simple terminal

License

NotificationsYou must be signed in to change notification settings

cjpbirkbeck/st

Repository files navigation

Here is a patched version of thesimple terminal bysuckless, "a simple terminal emulator for X which sucks less". Generally, I mostly use it withtmux, but it works perfectly fine without it.

Requirements

  • libX11: Basic Xorg headers
  • libXft: font rendering libraries
  • libXcursor: for a themed cursor

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

Nix/NixOS

For users of eitherthe nix package manager or NixOS can use the following default.nix to compile st into the nix store withnix-build. Based of an old version ofthe default in nixpkgs, so probably not the best version of this code but it works.

rec{pkgs=import<nixpkgs>{};patches=[];conf=null;extraLibs=[];libX11=pkgs.xorg.libX11;libXft=pkgs.xorg.libXft;libXcursor=pkgs.xorg.libXcursor;cjpb-st=withpkgs;stdenv.mkDerivationrec{name="st-0.8.3";src=./.;inheritpatches;nativeBuildInputs=[pkgconfigncurses];buildInputs=[libX11libXftlibXcursor]++extraLibs;preBuild=''      sed -i -e '/share\/applications/d' Makefile    '';installPhase=''      TERMINFO=$out/share/terminfo make install PREFIX=$out    '';};}

To install st in the nix store in NixOS, you can add the following override:

{pkgs,config, ...}:{nixpkgs.config.packageOverrides=pkgs:withpkgs;rec{st_patched=st.overrideAttrs(oldAttr:rec{src=fetchFromGitHub{owner="cjpbirkbeck";repo="st";# Replace this with the current revision!rev="0000000000000000000000000000000000000000";# Likewise, replace this with current sha256!sha256="0000000000000000000000000000000000000000000000000000";};buildInputs=withpkgs.xorg;[libX11libXftlibXcursor];preBuild=''        sed -i -e '/share\/applications/d' Makefile      '';installPhase=''        TERMINFO=$out/share/terminfo make install PREFIX=$out        mkdir -p $out/share/applications/        install -D st.desktop $out/share/applications/      '';});};}

Patches

The following patches have been applied to vanilla st 0.8.3:

  • Alpha Focus Highlight: If a compositor likepicom is enabled, a terminal with focus will have a set opacity, while all others will have another opacity.
  • Anygeomtry: Set st window sizes by pixel size, with the argument-G [width[xheight]].
  • Anysize: Dynamically set the inner border size and centers the terminal if the windows is not a multiple of the character size and inner border size. Useful for users of tiling window managers likedwm,awesomewm,i3wm, etc.
  • Blinking cursor: Makes the cursor blink, like the terminals of yore.
  • Boxdraw: Allows for the drawing of Unicode line characters, allowing programs like tmux to draw lines without gaps.
  • Clipboard: Use Xorg's clipboard, not primary.
  • Font2: Allows for different fonts to be used as "backup". Currently, I have not enabled any so far.
  • Netwmicon: Hardcodes a default icon.
  • Newterm: Using the keybinding ofC-S-Return to open a new terminal with the present working directory as the current instance.
  • OSC-10-11-12: Enables those escape codes for modifying the background colours.
  • Scrollback: Enable a scrollback buffer by default …
  • Scrollback mouse: … and allow it to scroll that buffer with the scrollwheel (or buttons in the case of trackpoint). Note that I have disable the middle click and made scrolling with the scrollwheel default, without needing to press shift.
  • Themed cursor: Uses the cursor from the cursor theme. RequireslibXcursor.
  • Undercurl: This patch adds support for curly underlining, such as vim's spelling correction.
  • Vertcenter: Center oversized lines horizontally.
  • Workingdir: Specify a working directory with-d [path]. Path can be absolute or relative.

Theming

Colours are based off of theOceanic Material theme fromiTerm2 Color Schemes. Specifically, it comes from a conversion the termite theme withterminal.sexy.

Not that I have changed some of the colours to be easier to read. Specifically, color5 (normal Magenta) was originally#8800a0 and color7 (normal White) was#a4a4a4 and color13 (bright Magenta) was originally#aa4abc.

ColoursNormalBright
Black#000000#777777
Red#ee2b2a#dc5c60
Green#40a33f#70be71
Yellow#ffea2e#fff163
Blue#1e80f0#54a4f3
Magenta#c900ed#C585d1
Cyan#16afca#42c7da
White#e3e3e3#ffffff

Background =#1c262b

Foreground =#c2c8d7

Running st

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

tic -sx st.info

Seethe man page for additional details.

TODO

  • Better integration with tmux, maybe using externalpipe?

License

SeeLICENSE for details.

Credits

Based on Aurélien APTEL bt source code.

Patch credits

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp