XRDB(1)
๐ xrdb(1) โจ General Commands Manual โจ
๐ NAME
xrdb โ X server resource database utility ๐ง
๐ SYNOPSIS
xrdb [-option ...] [filename]
๐ DESCRIPTION
okay so xrdb is how you get or set the contents of the RESOURCE_MANAGER property on the root window of screen 0, or the SCREEN_RESOURCES property on the root window of any or all screens, or everything combined ๐ฆ You'd normally run this from your X startup file, bestie.
Most X clients look at the RESOURCE_MANAGER and SCREEN_RESOURCES properties to find your preferences about color, fonts, and so on ๐ Keeping that info in the server (where every client can see it) instead of on disk is literally the fix for the old versions of X that made you maintain defaults files on every machine you might use ๐ญ It also lets you change defaults on the fly without editing any files. iconic, honestly ๐
The RESOURCE_MANAGER property is for resources that apply to all screens of the display. The SCREEN_RESOURCES property on each screen holds extra (or overriding) resources for that one screen. (When there's only one screen, SCREEN_RESOURCES is normally not used, and everything just goes into RESOURCE_MANAGER ๐)
The file you give as filename (or standard input if you pass - or no filename at all) can get run through the C preprocessor, and it's optional ๐ซถ The symbols that get defined depend on what the server you're using can do. Here's the full list:
SERVERHOST=hostnameโ the hostname part of the display you're connected to ๐SRVR_nameโ theSERVERHOSThostname turned into a legal identifier. So"my-dpy.lcs.mit.edu"becomesSRVR_my_dpy_lcs_mit_eduโจHOST=hostnameโ same asSERVERHOST๐DISPLAY_NUM=numโ the number of the display on the server host ๐ธCLIENTHOST=hostnameโ the name of the host wherexrdbis running ๐CLNT_nameโ theCLIENTHOSThostname turned into a legal identifier. So"expo.lcs.mit.edu"becomesCLNT_expo_lcs_mit_edu๐ฆRELEASE=numโ the vendor release number for the server. How this number gets read depends onVENDOR๐ฅREVISION=numโ the X protocol minor version the server supports (currently0) ๐VERSION=numโ the X protocol major version the server supports (should always be11) ๐VENDOR="vendor"โ a string literal naming the vendor of the server ๐VNDR_nameโ theVENDORname string turned into a legal identifier. So"MIT X Consortium"becomesVNDR_MIT_X_ConsortiumโญEXT_nameโ a symbol gets defined for each protocol extension the server supports. Each extension name gets turned into a legal identifier, so"X3D-PEX"becomesEXT_X3D_PEX๐งNUM_SCREENS=numโ the total number of screens ๐SCREEN_NUM=numโ the number of the current screen, counting from zero ๐BITS_PER_RGB=numโ the number of significant bits in an RGB color spec. It's the log base 2 of how many distinct shades of each primary the hardware can make. Heads up, it usually isn't related toPLANES๐ซถCLASS=visualclassโ one ofStaticGray,GrayScale,StaticColor,PseudoColor,TrueColor, orDirectColor. This is the visual class of the root window ๐ธCLASS_visualclass=visualidโ the visual class of the root window, in a form you can#ifdefon. The value is the numeric id of the visual ๐COLORโ only defined ifCLASSis one ofStaticColor,PseudoColor,TrueColor, orDirectColor๐CLASS_visualclass_depth=numโ a symbol gets defined for each visual the screen supports. The symbol includes the visual's class and depth, and the value is the numeric id of the visual. (If more than one visual has the same class and depth, the numeric id of the first one the server reports gets used ๐ฆ)HEIGHT=numโ the height of the root window in pixels ๐WIDTH=numโ the width of the root window in pixels ๐PLANES=numโ the number of bit planes (the depth) of the root window ๐X_RESOLUTION=numโ the x resolution of the screen in pixels per meter ๐Y_RESOLUTION=numโ the y resolution of the screen in pixels per meter ๐
Quick note on the identifiers: SRVR_name, CLNT_name, VNDR_name, and EXT_name are all made by swapping every character that isn't a letter or digit for an underscore (_) ๐ซถ
Lines that start with an exclamation mark (!) get ignored, so you can use them as comments ๐
And since xrdb can read from standard input, you can change the contents of properties directly from a terminal or a shell script. main character energy ๐คโจ
โ๏ธ OPTIONS
okay so the xrdb program takes these options ๐
-helpโ this one (or literally any option it doesn't support) prints a short description of the allowed options and parameters ๐-versionโ prints thexrdbversion and then exits, without doing anything else ๐ธ-display displayโ picks the X server to use. See X(7) for the deets ๐ฅ๏ธ It also decides which screen-screenuses, and which screen the preprocessor symbols come from for-global๐ฆ-allโ the operation runs on the screen-independentRESOURCE_MANAGERproperty and on the screen-specificSCREEN_RESOURCESproperty of every screen on the display ๐ For example, pair it with-queryand you get the contents of every property printed out ๐จ๏ธ With-load,-override, or-merge, the input file gets processed once per screen. Whatever resources show up in common across every screen's output get collected and applied as the screen-independent resources, and the leftovers get applied to each individual per-screen property ๐ง This is the default mode of operation, no cap ๐-globalโ only touches the screen-independentRESOURCE_MANAGERproperty ๐-screenโ only touches theSCREEN_RESOURCESproperty of the default screen of the display ๐ผ๏ธ-screensโ touches theSCREEN_RESOURCESproperty of each screen on the display ๐ For-load,-override, and-merge, the input file gets processed for each screen ๐-nโ when you use it with-load,-override, or-merge, the changes to the properties get shown on standard output but not actually made. With-edit, the same goes for the resource file ๐-quietโ hides the warnings about duplicate entries ๐คซ-cpp filenameโ the pathname of the C preprocessor program you want to use.xrdbwas built around CPP, but any filter program that takes the-D,-I, and-Uoptions will work ๐งช-nocppโ tellsxrdbto skip the preprocessor step and load the input file straight into the properties ๐ซ-undefโ passed along to the C preprocessor if you use it. It stops the preprocessor from predefining any system-specific macros ๐งน-Eโ shows anycppcommand that gets run, plus its output, on standard output ๐ If you also used-nocpp, the input file gets shown just as it was read. The changes still happen unless you also use-nโจ-symbolsโ prints the symbols that are defined for the preprocessor onto standard output ๐-queryโ prints the current contents of the specified properties onto standard output ๐ค Heads up, bestie: preprocessor commands live in the input resource file, not in the property itself, so they won't show up in this output ๐ญ If you want to merge property contents back into your input file without wrecking those preprocessor commands, use-editinstead ๐ซถ
โ ๏ธ Preprocessor lines only exist in the input file, so-queryoutput won't include them. Use-editif you want to keep them safe.
That's the first half, babes! ๐๐ More options are coming up next.
๐ FILES ๐
okay so xrdb doesn't load any files on its own ๐ but lots of desktop environments use it to load ~/.Xresources files when your session starts up. It's basically what sets up the resource database, and it's a generalized replacement for ~/.Xdefaults files ๐
โจ
๐ SEE ALSO ๐
X(7)๐ธappres(1)๐ฆlistres(1)๐ฆ- Xlib Resource Manager documentation ๐
- Xt resource documentation ๐
๐ ENVIRONMENT ๐
DISPLAYโ this is how xrdb figures out which display to use ๐ฅ๏ธ๐
๐ BUGS ๐
bestie, this one is a known issue ๐ญ the default for no arguments should be to query, not to overwrite, so it matches how other programs act. right now it doesn't, so be careful ๐
๐ AUTHORS ๐
Bob Scheifler and Phil Karlton wrote the original, and Jim Gettys rewrote it from there ๐ซถ๐
that's the whole page, bestie ๐ง X Version 11 with xrdb 1.2.2, and xrdb's manual page is XRDB(1), so you're all set ๐๐
๐ฆ where this page comes from
- alpine 3.24: xrdb-doc 1.2.2-r0 ยท MIT
- centos-stream 10: xrdb 1.2.2-5.el10 ยท HPND-DEC AND MIT-open-group
- debian trixie: x11-xserver-utils 7.7+11
- fedora 43: xrdb 1.2.2-6.fc43 ยท HPND-DEC AND MIT-open-group
- fedora 44: xrdb 1.2.2-7.fc44 ยท HPND-DEC AND MIT-open-group
- nixos 26.05: xrdb 1.2.2
- opensuse-leap 16.0: xrdb 1.2.2-160000.2.2 ยท MIT
- opensuse-leap 16.0: xrdb 1.2.2-160000.2.2 ยท MIT
- opensuse-leap 16.0: xrdb 1.2.2-160000.2.2 ยท MIT
- opensuse-leap 16.0: xrdb 1.2.2-160000.2.2 ยท MIT
- ubuntu noble: x11-xserver-utils 7.7+10build2
- ubuntu questing: x11-xserver-utils 7.7+11
- ubuntu resolute: x11-xserver-utils 7.7+11build1
- ubuntu stonking: x11-xserver-utils 7.7+11build1
- Copyright 1991, Digital Equipment Corporation
- Copyright 1991, 1994, 1998 The Open Group
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms