---
name: "register-window-manager"
section: "8"
platform: "linux"
package: "xfree86-common"
version: "3.3.2.3a-11"
release: "Debian 2.1 (Slink)"
platforms: ["linux"]
url: "https://new.carta.tech/register-window-manager"
---

# register-window-manager(8)

update available window manager information

## NAME

register-window-manager - update available window manager information

## SYNOPSIS

**register-window-manager** \[ --ask \] *action window-manager*

## DESCRIPTION

**register-window-manager** adds and deletes entries from the */etc/X11/window-managers* file.  Typically this command is invoked by the post-installation and post-removal scripts of a package containing an X window manager.  It may also be used by the system administrator to modify the list of registered window managers (to remove from the list an undesired default window manager or to register the existence of a window manager on the system that is not handled by the Debian packaging system).  Note that **register-window-manager** in no way affects package installation status, or itself adds or removes any files from the system.  Its sole purpose is to add and remove pathnames to window managers from the file */etc/X11/window-managers*.

*action* is one of --add, --remove, or --default.

\--add adds the specified window manager to the bottom of the */etc/X11/window-managers* file.

\--remove removes the specified window manager from the */etc/X11/window-managers* file.

\--default adds the specified window manager as the first entry in the */etc/X11/window-managers* file, thus making it the system's default window manager.

*window-manager* is the name of a window manager, either a simple filename or an absolute path.  A path to the window manager should not be given if the window manager is found under */usr/bin/X11*. The explicit path */usr/X11R6/bin* should **not** be given, as this makes the system needlessly dependent upon a particular release of the X Window System. **register-window-manager** will delete any occurences of paths it finds in */etc/X11/window-managers* that begin with */usr/X11R6/bin*, and will refuse to add a window manager using that path.

Note that if the file *$HOME/.xsession* is present and executable (and if the system is configured to use them) when the X session begins, the */etc/X11/window-managers* file is never used to determine which window manager to execute.

## OPTIONS

\--ask makes the *action* interactive and is useful if **register-window-manager** is being run from the shell prompt.  Package maintainer scripts should never invoke **register-window-manager** with the --ask option.

## EXAMPLES

A Debian window manager package should have something very similar to the following in its post-installation script.

if \[ -x /usr/sbin/register-window-manager \]; then

  register-window-manager --add twm

fi

Likewise for the post-removal script, if the package is being purged.

if \[ -x /usr/sbin/register-window-manager \]; then

  register-window-manager --remove twm

fi

It is a good idea for the maintainer script to test for the existence of the **register-window-manager** executable before attempting to run it, in the event that the system is in an unusual state.  It is not the end of the world if the */etc/X11/window-managers* cannot be modified.  Finally, until and unless Debian selects an official default window manager, window managers to be distributed with Debian GNU/Linux proper should not use the --default action (in many cases the first window manager a system administrator installs is a reasonable default).

## FILES

*/etc/X11/window-managers*

## SEE ALSO

[**Xsession**(5)](/Xsession/5.md), [**Xsession.options**(5)](/Xsession.options/5.md), [**window-managers**(5)](/window-managers/5.md)

## DIAGNOSTICS

**register-window-manager** returns zero on normal operation, and a nonzero value corresponding to the perl operation that failed on error.

## BUGS

See \<http://bugs.debian.org/xfree86-common\>.  If you wish to report a bug in **register-window-manager**, please see */usr/doc/debian/bug-reporting.txt* or the [**bug**(1)](/bug/1.md) command.

## AUTHOR

**register-window-manager** was written by Sean Perry, Marcelo Magallon, Branden Robinson, and Marcus Brinkmann.  It is maintained by Branden Robinson, who also wrote this man page.
