11

I'm working with many GIS applications under Gnome. It sometimes is very convenient to place one map over another to quickly spot differences.

There used to be a KDE trick to make any window (not just a terminal!) transparent, thereby allowing me to make one map semi-transparent and place it on the window of the other mapping software. Is there a similar trick for Gnome?

slm
  • 2,885
  • 1
  • 26
  • 32
Adam Matan
  • 12,289
  • 24
  • 71
  • 90

4 Answers4

8

I am not sure about Gnomw itself, but in Compiz, there is a plugin called "Opacity, Brightness and Saturation adjustments", which allows you control transparency of windows any way I can imagine, including Alt + {sroll} as Andrea Lazzarotto said.

Kris Harper
  • 13,397
  • 12
  • 56
  • 73
Andres
  • 904
  • 5
  • 9
7

Gnome extensions are OK, but if someone want use opacity/transparency occasionally - it is better use xprop command.

Run:

xprop -format _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0x7FFFFFFF

and then click on window to set it to 50% opacity.

  • 0x7FFFFFFF - 50% opacity
  • 0xFFFFFFFF - 100% opacity

Set opacity via providing window id (obtained from xwininfo):

xprop -id 0x3a00006 -format _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0x7FFFFFFF
Danniello
  • 71
  • 1
  • 2
  • this is best, as it works everywhere! (compiz transparency feature is missing for me) – Nicolas Jan 10 '20 at 18:39
  • 1
    `xprop -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY \ $(printf 0x%x $((0xffffffff * 30 / 100)))` Conveniece extension using printf for percentage to hexadecimal conversion. I have also made a short script as a desktop shortcut [documented here](https://askubuntu.com/a/1320458/258256) – Pau Coma Ramirez Mar 25 '21 at 11:07
6

For newer versions of Gnome (Gnome 3/Gnome Shell), you can use this extension to make windows transparent:

EDIT: To install in Gnome 3.14+

Gnome extensions have a file containing which version of Gnome they are compatible with - this is not always correct as the extension may work for other versions not specified in the file, so you need to get the extension from outside the gnome extension site, and modify the file and install it manually - this works a lot of the time with other extensions.

  1. Go the the extension page, and download the extension zip file.
  2. Extract it, and modify the shell-version line in the /transparentwindows-master/transparentwindows@ellen/metadata.json file to make sure it includes your shell version (e.g. 3.14):

     "shell-version": ["3.10", "3.12", "3.14"], 
    

    You can find your shell version if needed using gnome-shell --version

  3. Move the extracted files to ~/.local/share/gnome-shell/extensions, so it looks like this: /home/wilf/.local/share/gnome-shell/extensions/transparentwindows@ellen
  4. The extension should now work, though you may need to restart the shell with Alt+F2+r+Enter, and enable it in Gnome Tweak Tool or similar.

Also note that you can do a issue/bug report to the developer to ask for the extension the Gnome Extension site to be updated - in this case there is one here. You can also make your own commit to the extension to include 3.14+ versions.

Wilf
  • 29,694
  • 16
  • 106
  • 164
  • this extension, does not work with GNOME 3.14 and LATER versions ... do you know extension compatible with current version ? – Jiří Doubravský May 24 '15 at 16:20
  • @Jiff - it does (i have used recently in 3.14), you just can't install it from the extension page. I''ll add how to install it in my answer – Wilf May 24 '15 at 21:26
  • This extension is abandonware but it DOES work if you follow the instructions above – Jonathan Jan 09 '18 at 20:28
  • @JonathanLeaders out of interest, which shell version? – Wilf Jan 12 '18 at 13:08
  • 1
    I have tested on `3.26.2` – Jonathan Jan 14 '18 at 01:05
  • 2
    The guy fucking deleted the entire repo. All hope is lost! Back to KDE ?? – Theodore R. Smith Feb 05 '18 at 04:28
  • There is a old version (3.8... probably what I wrote this answer for!) at https://github.com/Stefanotis360/transparentwindows. It must be fairly recent as a version which supported `["3.10", "3.12", "3.14", "3.22", "3.22.2"]` can be found in Google's cache. Versions up to `3.10` are on gnome extensions, updating used to be simple as uploading a zip but not sure now. I am wondeering it is a possiblity the code was not under a review spec for the site so the github user nuked the repo since this has been linked on the page for a month! – Wilf Feb 07 '18 at 22:20
3

Hold down the Alt key and then scroll with your mouse wheel.

Kris Harper
  • 13,397
  • 12
  • 56
  • 73
Andrea Lazzarotto
  • 7,823
  • 3
  • 38
  • 56