transset
Set window transparency
SYNOPSIS
transset [OPTIONS] [ALPHA]
transset [OPTIONS] WINDOWID [ALPHA]
PARAMETERS
ALPHA
A floating-point value between 0.0 (fully transparent) and 1.0 (fully opaque), representing the desired opacity level. If ALPHA is provided but WINDOWID is omitted, transset will prompt the user to click on the desired window. If both ALPHA and WINDOWID are omitted, transset prints usage information.
WINDOWID
The numerical ID of the target window whose opacity is to be changed. This ID can be obtained using utilities like xwininfo. If omitted and ALPHA is provided, transset enters an interactive mode, prompting the user to click on the desired window.
-h, --help
Displays a brief help message and exits.
-V, --version
Displays version information and exits.
-n, --no-exit
Keeps transset running after setting the window property, rather than exiting immediately. This is rarely used in typical scenarios.
-a, --all
Applies the specified opacity (ALPHA) to all currently managed windows on the X display. Useful for system-wide transparency changes.
-c, --click
When interactive window selection is used (e.g., by running transset 0.5 and clicking a window), this option causes transset to print the selected window's ID to standard output before exiting. This is primarily useful for scripting.
DESCRIPTION
transset is a command-line utility for the X Window System that enables users to dynamically change the opacity (transparency) level of specific windows. It operates by setting the _NET_WM_WINDOW_OPACITY Extended Window Manager Hint (EWMH) property on the target window. This property is then interpreted by a running compositing window manager (such as xcompmgr, picom, KWin, or Mutter) to render the window with the specified transparency. It is often used in shell scripts to achieve visual effects, manage desktop appearance, or to make certain application windows less obtrusive. Without a compositing manager, transset will execute but have no visible effect on window transparency.
CAVEATS
Requires a running compositing window manager (e.g., xcompmgr, picom, KWin, Mutter) for the transparency effects to be visible. Without one, the command will execute but have no visual impact.
Only affects windows that support and correctly interpret the _NET_WM_WINDOW_OPACITY EWMH property. Most modern toolkits and applications support this.
Behavior and available options can vary slightly between different implementations or versions of transset (e.g., the original transset from xcompmgr versus transset-df).
THE _NET_WM_WINDOW_OPACITY PROPERTY
transset functions by manipulating the _NET_WM_WINDOW_OPACITY Extended Window Manager Hint (EWMH) property on an X window. This property, defined by the NetWM specification, stores the desired opacity level as a 32-bit cardinal value. A value of 0x00000000 represents fully transparent, and 0xFFFFFFFF represents fully opaque. transset converts the 0.0-1.0 floating-point ALPHA value into this 32-bit integer representation before setting the property. Compositing managers monitor changes to this property and apply the corresponding visual transparency effect.
COMMON USAGE EXAMPLES
Make a window 50% transparent by clicking it:
transset 0.5
Then click the desired window.
Make a specific window 80% opaque:
First, find the window ID using xwininfo (e.g., 0x4800002).
transset 0x4800002 0.8
Make all windows 25% transparent:
transset -a 0.75
Toggle a window's opacity (e.g., between 1.0 and 0.3):
This often requires a script due to transset's simple nature.
#!/bin/bash
WID=$(xwininfo | grep 'Window id:' | awk '{print $4}')
CURRENT_OPACITY=$(xprop -id $WID _NET_WM_WINDOW_OPACITY | awk '{print strtonum($3)/4294967295}')
if (( $(echo "$CURRENT_OPACITY < 0.5" | bc -l) )); then
transset $WID 1.0
else
transset $WID 0.3
fi
HISTORY
transset originated as part of the xcompmgr project, an early and foundational compositing manager for the X Window System. Its primary purpose was to provide a simple command-line interface for manipulating the _NET_WM_WINDOW_OPACITY X property, demonstrating and facilitating basic window transparency. While xcompmgr has been superseded by more advanced compositors like picom, transset remains a functional and often included utility for directly controlling window opacity on X.org, leveraging the EWMH standard.