Alpha Focus Highlight
Patch for suckless' simple terminal (
st), which allows the user to specify two distinct opacity values / background colors; one for the focused- and one for unfocused windows' background.
This enables the user to spot the focused window at a glance.
The patch is based on the alpha patch; i.e. is to be
applied after applying the alpha patch.
Contributions & Bug Reports
Building, customizing and installing the patch
1. Optional Dependencies
The opacity functionality of this patch requires an
X composite manager (e.g.
xcompmgr), which can for instance be installed via
sudo pacman -S picom on Arch Linux and
picom -b. The composite manager has to be relaunched after booting.
2. Applying the patch
Apply the patch to
st's source code and build code via
patch < [PATCH_NAME]
This patch performs changes in the
config.def.h file, which need to be manually merged into a
config.h file. The following four variables can be adapted:
alphaUnfocusedopacity of the terminal when focused / not focused.
bgUnfocusedbackground color when focused / not focused.
4. Build & install
make; sudo make install
If you want to try out the current version of the patch before patching your own build, check out this repository, which contains a merged version of this patch with a reasonable configuration.
The patch comes
- merged into the alpha patch (
alpha + focus) or
- for patching on top of an already applied alpha patch (
I recommend downloading the alpha patch from the
alpha patch page and using
Patch: focus, that way you
make sure that you apply the latest version of the alpha patch.
Note that patch errors can occur when the code in the st repo is updated. Please report an Issue or contribute a merged patch in that case.
Patch: alpha + focus
Note: The benefit of the
alpha patch and the
Alpha Focus Highlight patch are the ability to
restrict the transparency only to the background color currently in use, hence keeping the font in
the foreground solid and readable.
If the goal is to apply transparency independent on the content, you do not require any patch for
st, instead add
inactive-opacity = 0.2;
active-opacity = 0.8;
picom configuration file and keep a vanilla
If you want to configure
active-opacity rules in order to apply opacity to
other applications, but keep the benefits of the st alpha patches, have a look at
this picom configuration
in which opacity management configured to be performed by