Is it possible to set transparency per window in Ubuntu 20.04?

I like for example the function you've got per window "above other windows" Is it also somehow possible to set transparency of a window?


Solution 1:

From the Command Line

Ubuntu 20.04 should ship with a command line tool called transset which provides some useful options for setting the transparency of a window.

In my opinion, the options that work best for quickly changing a window's transparency level are the -p flag (which targets the window under the cursor) and the --inc/--dec flags (which respectively increase and decrease the transparency value by a given amount).

Note that the transparency value is a decimal value between 0 and 1.

To make the window more transparent:

$ transset -p --dec 0.05

To make the window more opaque:

$ transset -p --inc 0.05

Making it better...

You can make it easier to toggle by pairing the aforementioned transset commands with xbindkeys. The following steps will make Alt + MouseWheel UP and Alt + MouseWheel DOWN control the opacity of the window under the cursor.

First, use apt (or apt-get) to install the tool:

$ sudo apt install xbindkeys

Then create and edit the xbindkeys configuration:

$ xbindkeys --default > ~/.xbindkeysrc && vi ~/.xbindkeysrc

Add the following lines to ~/.xbindkeysrc:

...

"transset -p --inc 0.05"
  alt + b:4

"transset -p --dec 0.05"
  alt + b:5

...

Save and exit the configuration file and reload the xbindkeys configuration with:

$ killall xbindkeys
$ xbindkeys

Now you can use Alt + MouseWheel UP/DOWN to change the transparency of the window under the cursor.