11.8. Programs for the X Window System

11.8.1. Providing X support and package priorities

Programs that can be configured with support for the X Window System must be configured to do so and must declare any package dependencies necessary to satisfy their runtime requirements when using the X Window System. If such a package is of higher priority than the X packages on which it depends, it is required that either the X-specific components be split into a separate package, or that an alternative version of the package, which includes X support, be provided, or that the package’s priority be lowered.

11.8.2. Packages providing an X server

Packages that provide an X server that, directly or indirectly, communicates with real input and display hardware should declare in their Provides control field that they provide the virtual package xserver. 5

11.8.3. Packages providing a terminal emulator

Packages that provide a terminal emulator for the X Window System which meet the criteria listed below should declare in their Provides control field that they provide the virtual package x-terminal-emulator. They should also register themselves as an alternative for /usr/bin/x-terminal-emulator, with a priority of 20. That alternative should have a slave alternative for /usr/share/man/man1/x-terminal-emulator.1.gz pointing to the corresponding manual page.

To be an x-terminal-emulator, a program must:

  • Be able to emulate a DEC VT100 terminal, or a compatible terminal.

  • Support the command-line option -e command, which creates a new terminal window 6 and runs the specified command. <command> may be multiple arguments, which form the argument list to the executed program. In other words, the behavior is as though the arguments were passed directly to execvp, bypassing the shell. (xterm’s behavior of falling back on using the shell if -e had a single argument and exec failed is permissible but not required.)

  • Support the command-line option -T title, which creates a new terminal window with the window title title.

11.8.4. Packages providing a window manager

Packages that provide a window manager should declare in their Provides control field that they provide the virtual package x-window-manager. They should also register themselves as an alternative for /usr/bin/x-window-manager, with a priority calculated as follows:

  • Start with a priority of 20.

  • If the window manager supports the Debian menu system, add 20 points if this support is available in the package’s default configuration (i.e., no configuration files belonging to the system or user have to be edited to activate the feature); if configuration files must be modified, add only 10 points.

  • If the window manager complies with The Window Manager Specification Project, written by the Free Desktop Group, add 40 points.

  • If the window manager permits the X session to be restarted using a different window manager (without killing the X server) in its default configuration, add 10 points; otherwise add none.

That alternative should have a slave alternative for /usr/share/man/man1/x-window-manager.1.gz pointing to the corresponding manual page.

11.8.5. Packages providing fonts

Packages that provide fonts for the X Window System 7 must do a number of things to ensure that they are both available without modification of the X or font server configuration, and that they do not corrupt files used by other font packages to register information about themselves.

  1. Fonts of any type supported by the X Window System must be in a separate binary package from any executables, libraries, or documentation (except that specific to the fonts shipped, such as their license information). If one or more of the fonts so packaged are necessary for proper operation of the package with which they are associated the font package may be Recommended; if the fonts merely provide an enhancement, a Suggests relationship may be used. Packages must not Depend on font packages. 8

  2. BDF fonts must be converted to PCF fonts with the bdftopcf utility (available in the xfonts-utils package, gzipped, and placed in a directory that corresponds to their resolution:

    • 100 dpi fonts must be placed in /usr/share/fonts/X11/100dpi/.

    • 75 dpi fonts must be placed in /usr/share/fonts/X11/75dpi/.

    • Character-cell fonts, cursor fonts, and other low-resolution fonts must be placed in /usr/share/fonts/X11/misc/.

  3. Type 1 fonts must be placed in /usr/share/fonts/X11/Type1/. If font metric files are available, they must be placed here as well.

  4. Subdirectories of /usr/share/fonts/X11/ other than those listed above must be neither created nor used. (The PEX, CID, Speedo, and cyrillic directories are excepted for historical reasons, but installation of files into these directories remains discouraged.)

  5. Font packages may, instead of placing files directly in the X font directories listed above, provide symbolic links in that font directory pointing to the files’ actual location in the filesystem. Such a location must comply with the FHS.

  6. Font packages should not contain both 75dpi and 100dpi versions of a font. If both are available, they should be provided in separate binary packages with -75dpi or -100dpi appended to the names of the packages containing the corresponding fonts.

  7. Fonts destined for the misc subdirectory should not be included in the same package as 75dpi or 100dpi fonts; instead, they should be provided in a separate package with -misc appended to its name.

  8. Font packages must not provide the files fonts.dir, fonts.alias, or fonts.scale in a font directory:

    • fonts.dir files must not be provided at all.

    • fonts.alias and fonts.scale files, if needed, should be provided in the directory /etc/X11/fonts/fontdir/package.extension, where fontdir is the name of the subdirectory of /usr/share/fonts/X11/ where the package’s corresponding fonts are stored (e.g., 75dpi or misc), package is the name of the package that provides these fonts, and extension is either scale or alias, whichever corresponds to the file contents.

  9. Font packages must declare a dependency on xfonts-utils in their Depends or Pre-Depends control field.

  10. Font packages that provide one or more fonts.scale files as described above must invoke update-fonts-scale on each directory into which they installed fonts before invoking update-fonts-dir on that directory. This invocation must occur in both the postinst (for all arguments) and postrm (for all arguments except upgrade) scripts.

  11. Font packages that provide one or more fonts.alias files as described above must invoke update-fonts-alias on each directory into which they installed fonts. This invocation must occur in both the postinst (for all arguments) and postrm (for all arguments except upgrade) scripts.

  12. Font packages must invoke update-fonts-dir on each directory into which they installed fonts. This invocation must occur in both the postinst (for all arguments) and postrm (for all arguments except upgrade) scripts.

  13. Font packages must not provide alias names for the fonts they include which collide with alias names already in use by fonts already packaged.

  14. Font packages must not provide fonts with the same XLFD registry name as another font already packaged.

11.8.6. Application defaults files

Application defaults files must be installed in the directory /etc/X11/app-defaults/ (use of a localized subdirectory of /etc/X11/ as described in the X Toolkit Intrinsics - C Language Interface manual is also permitted). They must be registered as conffiles or handled as configuration files.

Customization of programs’ X resources may also be supported with the provision of a file with the same name as that of the package placed in the /etc/X11/Xresources/ directory, which must be registered as a conffile or handled as a configuration file. 9

11.8.7. Installation directory issues

Historically, packages using the X Window System used a separate set of installation directories from other packages. This practice has been discontinued and packages using the X Window System should now generally be installed in the same directories as any other package. Specifically, packages must not install files under the /usr/X11R6/ directory and the /usr/X11R6/ directory hierarchy should be regarded as obsolete.

Include files previously installed under /usr/X11R6/include/X11/ should be installed into /usr/include/X11/. For files previously installed into subdirectories of /usr/X11R6/lib/X11/, package maintainers should determine if subdirectories of /usr/lib/ and /usr/share/ can be used. If not, a subdirectory of /usr/lib/X11/ should be used.

Configuration files for window, display, or session managers or other applications that are tightly integrated with the X Window System may be placed in a subdirectory of /etc/X11/ corresponding to the package name. Other X Window System applications should use the /etc/ directory unless otherwise mandated by policy (such as for Application defaults files).