editres
Dynamically edit X resources of applications
SYNOPSIS
editres [-display display] [-geometry geometry]
PARAMETERS
-display display
Specifies the X server to which editres should connect. If not specified, it uses the value of the DISPLAY environment variable.
-geometry geometry
Sets the initial size and position of the editres window on the screen. The format is standard X geometry string (e.g., 800x600+100+50).
DESCRIPTION
editres is a graphical utility designed for inspecting and modifying resources of running Xt (X Toolkit Intrinsics) based X applications. It provides a tree-like view of an application's widget hierarchy, allowing users to select individual widgets and examine their associated resources. This tool is invaluable for developers debugging Xt applications, enabling them to understand the resource inheritance, identify resource conflicts, and dynamically test different resource values without the need to restart the application. Changes made through editres can be applied instantly to the running application, making it a powerful interactive debugging and customization aid for X11 programs built with the X Toolkit.
CAVEATS
Caveats:
editres only works with applications built using the X Toolkit Intrinsics (Xt) library that explicitly support the editres protocol.
Modern desktop environments largely utilize toolkits like GTK or Qt, making editres less relevant for contemporary applications.
The target application must be running and accessible on the specified X display.
Modification of resources can potentially cause unexpected behavior or crashes in the target application if values are set incorrectly.
HOW IT WORKS (THE EDITRES PROTOCOL)
editres communicates with the target Xt application using a special X protocol involving root window properties (atoms). When editres starts, it looks for the _XEDITRES_COMMAND atom on the root window. An Xt application, if it supports the protocol, listens for messages written to this atom by editres. Commands (e.g., 'get widget tree', 'set resource') are sent via this atom, and the application responds by writing data to the _XEDITRES_REPLY atom. This allows for real-time, bi-directional communication to query and modify the application's internal state.
GUI INTERACTION
The editres window typically displays two main panes: A tree view on the left showing the hierarchical structure of the target application's widgets, and a properties pane on the right that displays the resources for the currently selected widget in the tree.
Users can navigate the widget tree, select a widget, view its resources, and then modify the values of these resources. After modification, an 'Apply' or 'Send' button typically pushes the changes to the live application, allowing for immediate visual feedback and testing.
HISTORY
editres was developed as part of the X Consortium's X11R5 release, primarily to assist developers working with the X Toolkit Intrinsics and its various widget sets like Motif and Athena. Its purpose was to provide a dynamic introspection and debugging utility for Xt-based applications, a significant advancement over static resource files. While its prominence has waned with the shift towards newer GUI toolkits, it remains a testament to the powerful introspection capabilities built into the Xt toolkit and is still useful for maintaining or understanding legacy X11 applications.