I tried xrdb -query -all, appres XTerm xterm commands. but i could not get any background color information. I saw the manpage, the default Xwindow background color is white. But when i started my xwindows application, it will open with CornFlower blue background. I tried to look in the Xresources, Xdefaults, Xinitrc, and then app-defaults directory. But i could not get background related stuff. Please help me to figure out the background color information where it is.
1 Answer
If you are using xterm (rather than some terminal which emulates xterm), there are two background colors to consider:
- the default background for the terminal window
- the current color which might be set using escape sequences
Using appres XTerm, I might see these background resources:
*fontMenu*background: AntiqueWhite *VT100.scrollbar.background: gray60 *VT100*background: black *SimpleMenu*background: AntiqueWhite *mainMenu*background: AntiqueWhite *tekMenu*background: AntiqueWhite *form.background: AntiqueWhite *vtMenu*background: AntiqueWhite *Form.menubar.background: AntiqueWhite *Form.menubar*background: AntiqueWhite *Form.background: AntiqueWhite The VT100 one is what you would look for, for the default background. If you used the uxterm script, you would use appres UXTerm to get similar information.
Colors set with escape sequences do not show up in the output from appres. There are escape sequences (see XTerm Control Sequences) to set and query these values. A few programs such as xtermcontrol and xtermset make it simple to do this from a script, e.g.,
$ xtermcontrol --get-bg rgb:0000/0000/0000