Chapter 13. Managing User Preferences

It is a fundamental part of the X philosophy that the user, not the application, should be in control of the way things work. For this reason, applications should allow the user to specify window geometry and many other characteristics both via command line options and in a file that specifies default preferences. This chapter discusses the use of the resource manager, which helps an application to evaluate and merge its own default with user preferences. While the information in this chapter is not essential for X programming, it is essential for writing programs that will work in ways that users will come to expect. For additional information on the resource manager at work, see Chapter 12.

Applications can and should be made user customizable. Every application should provide command line options for the most important configurable elements of the application, such as colors or patterns for the window border and background, foreground colors for drawing, desired geometry of the application, fonts, and so on. Furthermore, an application should allow users to set all options through the resource database.

A resource is a configurable program option (completely different from a server resource, such as a window). There are a set of resource files and resource properties that may contain settings for program options. When all the resource files and properties are merged into a single database by Xlib, the result is called the resource database ...

Get XLIB Programming Manual, Rel. 5, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.