Trying to achieve fake transparency in Urxvt – can only get a black background

background-processurxvt

I'm trying to achieve a (fake) transparent gray background in my URxvt (rvxt-unicode) terminal emulator.

Doing this using composite transparency works as it should, but I can't get it to work using "fake" transparency!

In my .Xdefaults I enter the following:

*foreground: #AAAAAA
*background: #151515
URxvt*transparent: true
URxvt*shading: 33

And no matter what color I enter, I end up with a black, transparent background. Even if I were to enter the hex code for white, I'd get a black background.

As I said, with true transparency I get the correctly colored background, but for purposes of using w3img preview in Ranger FM, I need to use fake transparency instead in my terminal.

Best Answer

I've temporarily solved it - not a perfect hack, but it works.

To anyone who might want to use Urxvt with Ranger FM, using w3mimg-preview and transparency:

It won't work using true transparency, and I had problems getting a grey, false-transparent background in Urxvt using .Xdefaults.

So i turned to using Transset with the program Devilspie which makes every Urxvt window transparent as such:

  1. Sudo apt-get install Devilspie && transset.
  2. Mkdir ~/.devilspie && touch urxvt.ds
  3. Vim ~/.devilspie/urxvt.ds with following contents:

        (if
    
    (matches (window_class) "URxvt")
    (begin
      (spawn_async (str "transset-df -i " (window_xid) " .95" ) )
    )
    )
    

(Credit to the author of the following post)

  1. Added devilspie & to my autostart.sh (Openbox)

6 Success! Any Urxvt window I start is opaque by 95%, and I can use the transparent Urxvt with Ranger and it's image preview.

Thank you everyone for trying to help me out. Hope this might be of use for somebody in the future!