README.md (5778B)
1 # Kris's build of st (flexipatch) 2 3 The [suckless terminal (st)](https://st.suckless.org/) with additional features that make it the best terminal emulator. 4 5 This build is based on [st-flexipatch](https://github.com/bakkeby/st-flexipatch), which uses preprocessor directives to manage patches. This allows easy toggling of features without manual patching. 6 7 --- 8 9 ## How Patches Work (Preprocessor Directives) 10 11 Unlike traditional st patching, this build uses C preprocessor directives to include/exclude patches at compile time. To enable or disable a patch, edit `patches.h` and set the value to `1` (enabled) or `0` (disabled): 12 13 ```c 14 #define ALPHA_PATCH 1 /* enabled */ 15 #define FULLSCREEN_PATCH 0 /* disabled */ 16 ``` 17 18 Then rebuild: 19 ```bash 20 sudo make clean install 21 ``` 22 23 All patch options are documented in `patches.h`. The actual code for each patch lives in the source files, wrapped in `#if PATCH_NAME ... #endif` blocks. 24 25 --- 26 27 ## Features 28 29 ### Clipboard 30 31 | Keybinding | Action | 32 |------------|--------| 33 | `Ctrl+c` or `Ctrl+Shift+c` | Copy selection | 34 | `Ctrl+v` or `Ctrl+Shift+v` | Paste | 35 | `Right Click` | Paste from clipboard | 36 37 ### Scrollback 38 39 | Keybinding | Action | 40 |------------|--------| 41 | `Alt+k` / `Alt+Up` | Scroll up (1 line) | 42 | `Alt+j` / `Alt+Down` | Scroll down (1 line) | 43 | `Alt+u` / `Alt+PageUp` | Scroll up (page) | 44 | `Alt+d` / `Alt+PageDown` | Scroll down (page) | 45 46 ### Font & Zoom 47 48 | Keybinding | Action | 49 |------------|--------| 50 | `Alt+,` | Zoom in | 51 | `Alt+.` | Zoom out | 52 | `Alt+g` | Reset to default size | 53 | `Super+Shift+K/J` | Zoom in/out | 54 | `Super+Shift+U/D` | Zoom in/out (2x) | 55 56 ### Transparency 57 58 | Keybinding | Action | 59 |------------|--------| 60 | `Alt+s` | Increase transparency | 61 | `Alt+a` | Decrease transparency | 62 | `Alt+m` | Reset transparency (opaque) | 63 64 ### External Pipe 65 66 | Keybinding | Action | 67 |------------|--------| 68 | `Alt+l` | Open URL handler | 69 | `Alt+y` | Copy URL to clipboard | 70 | `Alt+o` | Copy terminal output | 71 72 ### Other 73 74 | Keybinding | Action | 75 |------------|--------| 76 | `Super+Shift+Enter` | Spawn new terminal in current directory | 77 | `Ctrl+Shift+U` | Unicode input (ISO 14755) | 78 79 --- 80 81 ## Enabled Patches 82 83 Configured in `patches.h`: 84 85 | Patch | Description | 86 |-------|-------------| 87 | alpha | Transparency support with configurable opacity | 88 | anygeometry | Dynamic geometry/borders | 89 | anysize | Resize to any pixel size | 90 | blinking_cursor | Cursor blinking support | 91 | boxdraw | Render box-drawing characters without font glyphs | 92 | clipboard | Clipboard integration (CLIPBOARD on selection) | 93 | columns | Doesn't cut text while resizing | 94 | copyurl | Select and copy URLs | 95 | externalpipe | Pipe terminal content to external commands | 96 | font2 | Secondary font support (emoji fallback) | 97 | iso14755 | Unicode input via dmenu | 98 | ligatures | HarfBuzz ligature support | 99 | newterm | Spawn new terminal in current directory | 100 | scrollback | Scroll history | 101 | scrollback_mouse | Scroll with mouse wheel + Shift | 102 | scrollback_mouse_altscreen | Mouse scroll in alternate screen | 103 | **sixel** | **Sixel graphics support (for manga-tui, etc.)** | 104 | swapmouse | Swap mouse buttons | 105 | sync | Synchronized updates to reduce flicker | 106 | xresources | Load settings from Xresources | 107 | xresources_reload | Live reload on SIGUSR1 | 108 109 --- 110 111 ## Appearance 112 113 - **Default font:** JetBrainsMono Nerd Font 114 - **Color scheme:** Gruvbox Dark 115 - **Transparency:** 85% (configurable) 116 - **Xresources:** Supports dynamic colors via `~/.Xdefaults` or `~/.Xresources` 117 - **Live reload:** `xrdb merge ~/.Xresources && kill -USR1 $(pidof st)` 118 119 --- 120 121 ## Installation 122 123 ### Dependencies 124 125 ```bash 126 # Arch 127 pacman -S harfbuzz imlib2 libxft fontconfig freetype2 128 129 # Debian/Ubuntu 130 apt install build-essential libxft-dev libharfbuzz-dev libimlib2-dev 131 132 # Fedora 133 dnf install harfbuzz-devel imlib2-devel libXft-devel 134 135 # Void 136 xbps-install libXft-devel libX11-devel harfbuzz-devel imlib2-devel 137 ``` 138 139 ### Build 140 141 ```bash 142 git clone https://github.com/krisyotam/st 143 cd st 144 sudo make clean install 145 xrdb merge ~/.Xresources 146 ``` 147 148 > Add the `xrdb merge` command to your WM's autostart. 149 150 > Requires a compositor (`xcompmgr`, `picom`, etc.) for transparency. 151 152 --- 153 154 ## Configuration 155 156 ### Enabling/Disabling Patches 157 158 Edit `patches.h` to toggle patches: 159 160 ```c 161 #define SIXEL_PATCH 1 /* Enable sixel graphics */ 162 #define FULLSCREEN_PATCH 0 /* Disable fullscreen */ 163 ``` 164 165 ### Customizing Settings 166 167 Edit `config.def.h` for: 168 - Font settings 169 - Colors (Gruvbox by default) 170 - Keyboard shortcuts 171 - Transparency level 172 - External pipe commands 173 174 After editing, rebuild: 175 ```bash 176 rm config.h && sudo make clean install 177 ``` 178 179 ### Xresources 180 181 This build reads settings from `~/.Xdefaults` or `~/.Xresources`. Changes reload live with: 182 183 ```bash 184 xrdb merge ~/.Xresources && kill -USR1 $(pidof st) 185 ``` 186 187 Example Xresources: 188 ``` 189 st.font: JetBrainsMono Nerd Font:pixelsize=15 190 st.alpha: 0.85 191 st.color0: #282828 192 st.background: #282828 193 st.foreground: #ffffff 194 ``` 195 196 --- 197 198 ## Sixel Graphics 199 200 This build includes sixel support for displaying images in the terminal. Applications like `manga-tui` can render images directly in st. 201 202 To verify sixel support: 203 ```bash 204 # If you have libsixel installed 205 img2sixel /path/to/image.png 206 ``` 207 208 --- 209 210 ## My Other Suckless Repos 211 212 - [dwm](https://github.com/krisyotam/dwm) - dynamic window manager 213 - [dwmblocks](https://github.com/krisyotam/dwmblocks) - modular status bar 214 - [surf](https://github.com/krisyotam/surf) - simple web browser 215 - [dmenu](https://github.com/krisyotam/dmenu) - application launcher 216 217 --- 218 219 ## Credits 220 221 - Based on [st-flexipatch](https://github.com/bakkeby/st-flexipatch) by bakkeby 222 - [suckless.org](https://st.suckless.org/) for the original st 223 224 --- 225 226 ## Contact 227 228 - Kris Yotam <krisyotam@protonmail.com> 229 - [https://krisyotam.com](https://krisyotam.com)