cmc/cleberg.net

My personal web garden & blog.

clone: git clone https://gitbay.org/cmc/cleberg.net.git

main: content/blog/2022-12-17-st.org · raw

 1#+date:        [2022-12-17 Sat 00:00:00]
 2#+title:       Suckless Simple Terminal on Fedora
 3#+description: Compiling and patching the Suckless Simple Terminal on Fedora.
 4#+slug:        st
 5#+filetags:    :linux:
 6
 7* st
 8
 9[[https://st.suckless.org][st]] standards for Simple Terminal, a simple terminal implementation for X made by
10the [[https://suckless.org][suckless]] team.
11
12This post walks through the dependencies needed and process to build and install
13=st= on Fedora Workstation.
14
15** Obtain Files
16
17To start, obtain the source files for =st= via =git clone=.
18
19#+begin_src sh
20mkdir ~/suckless && cd ~/suckless
21git clone https://git.suckless.org/st && cd st
22#+end_src
23
24** Dependencies
25
26Once you have the files and are in the =st= directory, ensure the following
27packages are installed.
28
29#+begin_src sh
30sudo dnf update && sudo dnf upgrade
31sudo dnf install gcc patch libX11-devel libXft-devel
32#+end_src
33
34** Building
35
36Before building, ensure that you read the README file.
37
38#+begin_src sh
39cat README
40#+end_src
41
42Once you've read the instructions, open the =config.mk= file and ensure it
43matches your setup. If you're not sure, leave the default options within the
44file.
45
46Finally, you can build =st= with the following command. Ensure you run as root
47(e.g., =sudo=) or else you may not end up with a usable application file.
48
49#+begin_src sh
50sudo make clean install
51#+end_src
52
53** Customization (Patches)
54
55Note that customizing =st= requires you to modify the source files or to
56download one of the [[https://st.suckless.org/patches/][available patches]] for suckless.org.
57
58If you've already installed =st= and want to customize or install a patch, start
59by uninstalling the current program.
60
61#+begin_src sh
62cd ~/suckless/st
63sudo make uninstall
64#+end_src
65
66Next, grab the =<path>.diff= file from the page of the patch you chose. For
67example, I will be using the [[https://st.suckless.org/patches/defaultfontsize/][defaultfontsize]] patch in the below example.
68
69#+begin_src sh
70wget https://st.suckless.org/patches/defaultfontsize/st-defaultfontsize-20210225-4ef0cbd.diff
71#+end_src
72
73Once the file is downloaded inside the =st= folder, apply the patch and
74re-install the program. You may need to install the =patch= command if you don't
75have it installed already (you should have installed it above).
76
77#+begin_src sh
78patch -i st-defaultfontsize-20210225-4ef0cbd.diff
79sudo make clean install
80#+end_src
81
82Once installed, you can use the default font size patch to launch =st= with any
83font size you wish:
84
85#+begin_src sh
86st -z 16
87#+end_src