URxvt background changes when it loses focus

Monday, Jul 8, 2019 12:48 pm
William Barnes

Running i3 with URxvt as my terminal emulator and Compton for compositing. I had the URxvt background set to a semi-transparent color derived from my wallpaper by pywal. I also had a rule increasing the transparency of unfocused windows.

When I switched the focus of terminals, the focused terminal would be the right color but the unfocused terminal would turn semi-transparent black. I was expecting the opacity to decrease, but the color to stay the same. It turns out that URxvt has its own default setting to fade the terminal when it loses focus. It appears this involves a black or grey overlay (the source of the color change). You can disable this with the --fade switch at runtime or with the following line in your Xresources:

URxvt.fading: 0

Note that the switch is “fade” while the config option is “fading”. The value is the amount by which to fade (so 0 is off, 100 is complete). Disabling this also made the text on my unfocused terminals more legible.