2

I previously was using MATE and XTerm always starts with a black background. I'm not sure why, but when I start XTerm in KDE, I get a white background. This is terrible for me so I want to change this default behaviour.

I have attempted different solutions that are posted online but none of them work for me. Here are some of them:

  • Making a .Xdefaults file in the home directory and setting the options there
  • Making a .XTerm file in the home directory and setting the options there
  • Making a .Xresources file and setting the options there
  • Unchecking "Apply colors to non-KDE4 applications" in the KDE control center

An interesting thing to note is that under MATE, the XTerm background is black and foreground is white, but I'm not even sure why. I can't change the defaults in MATE either.

I also tried using the following command, and this works for the current session, but it seems that it doesn’t stay between sessions, and it gets annoying having to google this command every time I start up my computer

printf 'xterm*background: black\nxterm*foreground: white\n' | xrdb -merge

I am looking for a solution, not a workaround. Workarounds include things like starting xterm and explicitly specifying the background and foreground colors, or using an alias for XTerm, or setting the color after XTerm has started, or running a script before or during the use of XTerm. There has to be a cause to this problem somewhere and I'd like to find out what it is.

I'm using Linux Mint Nadia (13.04).

1

Do two things:

  • Add to your startup scripts the command xrdb -merge ~/.Xdefaults (or .Xresources, or actually whatever file you want to write your configuration to). Apparently any executable script in the folder $HOME/.kde/Autostart will be executed at startup when you use KDE as your destkop environment; I can't check because I don't use KDE.
  • Add the resources to that file.
0

After randomly messing around with KDE themes for an unrelated issue, I have finally realized out why the XTerm background keeps being set as white only under KDE and not under any other desktop environment

The reason: KDE theme colors.

If you go to System Settings -> Application Appearance, under Colors, go to the Colors Tab, in the "Common Colors" color set, the "View Background" and the "View Text" determine the background and foreground colors of XTerm.

Unfortunately, I'm not sure how to make a special case via KDE for XTerm colors, because for other applications do like to keep this color settings. I would appreciate any suggestions.

0

I know your question is for KDE Plasma 4, but the following is the solution at least for Plasma 5:

Plasma 5 complies with the Freedesktop/XDG specification, including specifically the Desktop Application Autostart spec, meaning that it executes any .desktop files in $XDG_CONFIG_HOME/autostart. Assuming your system doesn't override XDG_CONFIG_HOME, then that directory will be ~/.config/autostart.

So in my case, I have a file ~/.Xresources that sets my appropriate X resource settings, and I simply need to tell my desktop to load it. To do so, per the Autostart spec referenced above, I put the following file (I called it xrdb.desktop) in ~/.config/autostart:

[Desktop Entry]
Type=Application
Name=X resources loader
Exec=xrdb -merge .Xresources
Comment=Load X resource files on startup of DE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.