xwinwrap
Embed application windows as desktop backgrounds
TLDR
Run a video using mpv
Run a video in fullscreen using mpv
Run a video using mpv with 80% opacity
Run a video using mpv in a second monitor 1600x900 with 1920 offset on X-axis
SYNOPSIS
xwinwrap [options] -- command [arguments]
PARAMETERS
-id
Specifies the X window ID to use. Defaults to creating a new window covering the root window.
-name
Specifies the window name to be used. Defaults to "xwinwrap".
-title
Specifies the window title to be used. Defaults to "xwinwrap".
-ni
Sets the 'niceness' value for the executed command using `nice`. Higher values mean lower priority. Defaults to not setting niceness.
-fs
Forces fullscreen mode; window covers entire screen.
-ov
Override redirect; bypass window manager.
-s
Specifies the size and position of the window. e.g., -s 640x480+100+100. If not specified, it covers the root window.
-argb
Use ARGB visual, needed for transparency, can break other applications.
--
Specifies the command to execute and its arguments. The double dash is required to separate xwinwrap options from the command's arguments.
DESCRIPTION
xwinwrap is a command-line utility designed to run an arbitrary command within a newly created X window. This allows you to embed applications, particularly those that don't inherently support X windowing directly, as part of your desktop environment. For example, you can use it to run OpenGL demos or simple animations as your desktop background, or to display system monitoring information. xwinwrap creates a window, then executes the specified command, giving it the ID of that window to manipulate. The key is that the launched application can then draw directly into that window.
It is particularly useful for 'root window' applications, creating visually appealing desktops with dynamic backgrounds or widgets. It relies on the X Window System's ability to treat windows as drawing surfaces.
CAVEATS
Applications used with xwinwrap must be able to receive an X window ID as an argument or environment variable (or otherwise know how to target a specific window). Problems may arise with window managers or applications not handling transparency correctly. Using the `-ov` option can sometimes lead to unexpected behavior, bypassing usual window management rules.
ENVIRONMENT VARIABLES
The executed command will have the following environment variables set:
`XWIN_ID`: The window ID of the newly created window.
Other environment variables are inherited from the environment in which xwinwrap is run.
USAGE EXAMPLES
- Run `glxgears` as root window background:
xwinwrap -ov -- glxgears - Run `xscreensaver -no-splash` in a small window:
xwinwrap -s 320x240+0+0 -- xscreensaver -no-splash
HISTORY
xwinwrap was created to provide a simple way to embed arbitrary applications within an X Window System environment, particularly for creating dynamic root window backgrounds. It became popular as a relatively lightweight solution to achieve visual effects that would otherwise require more complex window management or compositing setups. Development has slowed down over time, with the initial versions providing the core functionality that remains in use today.