X resources
The outlook of program using Detroint engine can be finetuned by user by changing the settings in X resources file. X resources file is located at PREFIX/etc/PROGRAM_NAME.res, and is defined as follows:
! ! The fallback app-defaults for PROGRAM_NAME. ! ! This file will be consulted for visual settings if resources are not present ! in xrdb database, ~/.Xdefaults or ~/.Xresources. ! !! ! Settings for menus !! ! ! Color name or color value in a format of #rrggbb or 0xrrggbb is ! supported. ! PROGRAM_NAME.menu.background: whitesmoke PROGRAM_NAME.menu.foreground: black PROGRAM_NAME.menu.bgSelected: gray50 PROGRAM_NAME.menu.bgSelectedHot: gray60 PROGRAM_NAME.menu.fgSelected: white PROGRAM_NAME.menu.fgDisabled: gray50 PROGRAM_NAME.menu.fgDisabledOverstrikeSize: 0 ! ! Margin size in pixels. ! PROGRAM_NAME.menu.marginWidth: 2 PROGRAM_NAME.menu.marginHeight: 2 ! ! Color name or color value in a format of #rrggbb or 0xrrggbb is ! supported. Opaque range is from 0 to 255. ! PROGRAM_NAME.menu.borderColor: gray40 PROGRAM_NAME.menu.borderColorOpaque: 64 ! ! Gap and separator size in pixels. Opaque range is from 0 to 255. ! PROGRAM_NAME.menu.gapHeight: 8 PROGRAM_NAME.menu.separatorHeight: 2 PROGRAM_NAME.menu.separatorOpaque: 64 ! ! Either tga image file, color name or color value in a format of ! #rrggbbaa or 0xrrggbbaa is supported. ! !PROGRAM_NAME.menu.borderLeftEdge: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderRightEdge: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderTopEdge: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderBottomEdge: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderUpperLeftCorner: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderLowerLeftCorner: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderUpperRightCorner: path_to_tga_image_file_here !PROGRAM_NAME.menu.borderLowerRightCorner: path_to_tga_image_file_here ! ! Selection border size in pixels. ! PROGRAM_NAME.menu.hilightBorderWidth: 1 PROGRAM_NAME.menu.hilightBorderHeight: 1 ! ! Color name or color value in a format of #rrggbb or 0xrrggbb is ! supported. ! PROGRAM_NAME.menu.hilightBorderLeftColor: gray80 PROGRAM_NAME.menu.hilightBorderRightColor: gray30 PROGRAM_NAME.menu.hilightBorderTopColor: gray80 PROGRAM_NAME.menu.hilightBorderBottomColor: gray30 PROGRAM_NAME.menu.hilightBorderLeftHotColor: gray30 PROGRAM_NAME.menu.hilightBorderRightHotColor: gray80 PROGRAM_NAME.menu.hilightBorderTopHotColor: gray30 PROGRAM_NAME.menu.hilightBorderBottomHotColor: gray80 ! !PROGRAM_NAME.menu.barFontFace: path_to_font_file_here PROGRAM_NAME.menu.barFontSize: 14 !PROGRAM_NAME.menu.itemFontFace: path_to_font_file_here PROGRAM_NAME.menu.itemFontSize: 14 !PROGRAM_NAME.menu.titleFontFace: path_to_font_file_here PROGRAM_NAME.menu.titleFontSize: 14 PROGRAM_NAME.menu.fontDPI: 0 ! ! Global HSV values to tune icon outlook, these can be either positive or ! negative integers. Hue range is from -360 to +360, saturation and value from ! -100 to +100. ! PROGRAM_NAME.menu.iconHue: 0 PROGRAM_NAME.menu.iconSaturation: 0 PROGRAM_NAME.menu.iconValue: 0 ! ! When this is set to 1, string orientation changes from right to left. ! PROGRAM_NAME.menu.orientation: 0 ! ! Remap menu keys to something else, see X11/keysymdef.h for possible names. ! !PROGRAM_NAME.menu.keyEscape: Escape !PROGRAM_NAME.menu.keyEnter: Return !PROGRAM_NAME.menu.keyLeft: Left !PROGRAM_NAME.menu.keyUp: Up !PROGRAM_NAME.menu.keyRight: Right !PROGRAM_NAME.menu.keyDown: Down ! ! Enabling these uses vi keys for movement instead of arrow keys. ! !PROGRAM_NAME.menu.keyLeft: h !PROGRAM_NAME.menu.keyUp: k !PROGRAM_NAME.menu.keyRight: l !PROGRAM_NAME.menu.keyDown: j !! ! Settings for widgets !! !PROGRAM_NAME.widget.profile: ! ! Color name or color value in a format of #rrggbb or 0xrrggbb is ! supported. Opaque range is from 0 to 255. ! PROGRAM_NAME.widget.shadowColor: #101016 PROGRAM_NAME.widget.shadowOpaque: 192 ! PROGRAM_NAME.widget.sliderSlitColor: #161913 ! !PROGRAM_NAME.widget.fontFace: path_to_font_file_here PROGRAM_NAME.widget.fontSize: 10 PROGRAM_NAME.widget.fontDPI: 0 ! ! Global HSV values to tune widget outlook, these can be either positive or ! negative integers. Hue range is from -360 to +360, saturation and value from ! -100 to +100. ! PROGRAM_NAME.widget.hue: 0 PROGRAM_NAME.widget.saturation: 0 PROGRAM_NAME.widget.value: 0 ! ! Widget attribute tunables. See documentation for syntax and possible values. ! !PROGRAM_NAME.widget.tunedAttributes: widget_tunables_here
Each setting should be self-explanatory. Basically menu and widget appearance can be modified by X resources file. PROGRAM_NAME is the name of the produced executable when program was compiled.
If widget.profile resource is set, widget files are looked from PREFIX/share/detroit/widgets/widget.profile-directory.
Widget tunedAttributes sets some widget attributes individually, for example, widget position and color can be changed this way. Format for tunedAttribute resource setting is:
PROGRAM_NAME.widget.tunedAttributes: widget_name.attribute=new_value, widget_name.another_attribute=new_value, ...
Where attributes are:
- image, replaces widget predefined image file (value is string),
- color, replaces widget solid color (value is color definition),
- hue, affects widget outlook (value is number),
- saturation, value is number,
- value, value is number,
- label_charset, replaces widget label charset (value is string),
- label_color, affects widget label (value is color definition),
- label_dpi, value is unsigned integer,
- label_font, replaces widget label font (value is string),
- label_justification, value is string and can be one of:
- left,
- right, or
- center.
- label_pos, value is string and can be one of:
- above,
- below,
- left, or
- right.
- label_pos_x, value is positive or negative integer moving label from its default position,
- label_pos_y, value is the same,
- label_size, value is unsigned integer,
- x, affects widget position (value is integer), and
- y, affects also widget position (value is integer).
According to above, widget can be moved ten pixels to left like this:
PROGRAM_NAME.widget.tunedAttributes: widget_name.x=-10
Copyright © 2025, Jani Salonen <salojan at goto10 piste co>. Piste is finnish word and means dot. All rights reserved.