Ubuntu – Lubuntu terminal background tranparency

18.04lubuntu

In Lubuntu distribution of Ubuntu 18.04.1 LTS, I try to set the background of the terminal with some transparency but it takes no effect.

I'm using LXterminal, which come with the distribution

Setting transparency

Is it anything of the new Lubuntu?

Best Answer

  • I couldn't find the transparency option either in lxterminal 0.3.1. Looks like they dropped it at some point. See https://sourceforge.net/p/lxde/bugs/910/. From there:

    Was due to a configure variable. Passing --enable-gtk3 to ./configure of any recent version (tested 0.3.1 sourceforge and git latest on "master") breaks faux transparency. So the gtk3 version of lxterminal seems to not support faux transparency.

    In any case, what this terminal had in the past was "fake transparency" also known as pseudo-transparency. You could only see through to the root window's wallpaper even if there's another application's window between your terminal and the root window. From the wikipedia entry:

    This pseudo-transparency, so called as the background pixmap of the root window is visible (analogous to desktop wallpaper) rather than any obscured windows, allows users to make windows look less imposing (such as Terminal emulators, which usually comprise large chunks of text), and to integrate the appearance of windows with their desktop themes.

    If you want true transparency, you can install Compton by running sudo apt install compton.

    Once that's installed, create ~/.config/compton.conf as a plain text file.

    Add the following content:

    inactive-opacity = 1.0;
    inactive-dim = 0.2;
    mark-ovredir-focused = true;
    opacity-rule = [ "80:class_g = 'Lxterminal'" ];
    shadow = false;
    no-dnd-shadow = true;
    no-dock-shadow = true;
    blur-background = false;
    

    and save the file. Then, via the menu, open Preferences > Default applications for LXSession.

    In there, click on the tab for Autostart and paste in

    compton --config /home/dkb/.config/compton.conf -b
    

    making sure to change dkb, which is my username, to yours.

    Autostart

    Log out and then log back in again.

    Now when you run lxterminal, you'll have true transparency: you'll see through to windows immediately below the terminal and your wallpaper if that's visible.

    You can change the value in the opacity rule from 80 in your compton.conf to suit your tastes: the lower, the more transparent your terminal will be.

    lxterminal with transparency

    Please note that my compton.conf is rather minimal so as not to consume more resources. Of course, you can change settings to have a lot of fancy effects :) See https://github.com/chjj/compton/blob/master/compton.sample.conf for more.

  • Related Question