How to reduce opacity of all of the windows/apps in the background?

Style your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
DaveJones
Level 2
Level 2
Posts: 57
Joined: Tue Sep 20, 2016 7:37 pm

How to reduce opacity of all of the windows/apps in the background?

Post by DaveJones »

Hi all,

I am looking for a theme, or a way to modify the default Cinnamon themes (Mint-X/Y), so that only the application window that's front-most is at full opacity. And for every window that's in the background, I would like to reduce its opacity by a certain percentage.

Is this possible? Do any themes do this? Anyone have some hints how to accomplish this by modifying default themes?
Thank you!
User avatar
JoanTheSpark
Level 1
Level 1
Posts: 30
Joined: Mon Jun 05, 2023 1:48 am

Re: How to reduce opacity of all of the windows/apps in the background?

Post by JoanTheSpark »

I can only talk on the latter request..

Copy the theme you're running (and want to mod) from /usr/share/themes/ into /home/<yourID>/.themes/ and give it a different name, otherwise it will be hard to distinguish from the original in the theme selector.
In that new location look for /gtk3.0 or /gtk3.20 and in there for a file called gtk.css

Anything that has got a ':backdrop' after it's name is a style for some aspect of a program that defines how it looks like when it is NOT in focus (i.e. in the background).
If such an entry has got a color value below it, you can directly affect the opacity.. for example 'color: #FFFFFF' would be a white, while 'color: rgba(255,255,255,1.0)' would also be a white with alpha definition.. if you change the last value to 0.0 it becomes 100% transparent.
There also seem to be 'opacity: x.x' entries or 'color: transparent' entries.. what works and what doesn't depends on the element you're dealing with. No idea if images (if there are such elements in your theme) can be affected this way too - I think they need to be images with alpha and their intrinsic opacity adjusted for the use case.. so one for :backdrop and one for "normal".

example (application headerbar in the background with 30% opacity - note: not all applications are gtk3 and/or have their headerbar correctly defined - which means this works for some and not for others):

Code: Select all

headerbar:backdrop {
  color: #888888;  /* title text color */
  background-color: rgba(16, 16, 16, 0.3); }
Check out this post by LPH for info on how to get some gtk debugging tools fired up to help you with telling what is what:
viewtopic.php?p=2416164#p2416164

PS: I have no idea if you'll be able to get ALL apps to obey the transparency as I have no idea how gtk2 or qt apps are being dealt with and told what to do.. good luck.
DaveJones
Level 2
Level 2
Posts: 57
Joined: Tue Sep 20, 2016 7:37 pm

Re: How to reduce opacity of all of the windows/apps in the background?

Post by DaveJones »

Thank you so much JoanTheSpark !!!
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: How to reduce opacity of all of the windows/apps in the background?

Post by Drugwash »

DaveJones wrote: Wed Jan 17, 2024 7:57 pm I am looking for [...] a way to modify the default Cinnamon [...], so that only the application window that's front-most is at full opacity. And for every window that's in the background, I would like to reduce its opacity by a certain percentage.
Following your idea I cropped up a Cinnamon Extension that does precisely what you want without messing with themes.
Please note this extension has been very limitedly tested, and only under Mint 19.2 (so far). It does work but:
- may NOT work under Wayland (can't test myself);
- needs more polishing in regard to stack order of background windows (which one is actually above the other if trying to switch active window);
- may interfere with other extension(s), disabling them; if that happens a Cinnamon reload should fix it;
- behavior is unknown when there are A LOT of open windows, there may be a significant delay in transitions;
- it will not be found in official Spices list, and maintenance is not guaranteed unless someone else forks it, registers it, and commits to its maintenace;

If you agree to the above shortcomings you may download and install it below:
no-distraction@drugwash_1.0.0.zip
(8.17 KiB) Downloaded 52 times
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: How to reduce opacity of all of the windows/apps in the background?

Post by Drugwash »

My bad, first version was whipped up in a hurry and is buggy. Forgot about Tweener being replaced by ease in Cinnamon 5+, and also some variables were mixed up.

In the mean time I managed to launch a 21.2 virtual machine, upgraded to 21.3 and tested this extension. Fixed it properly for Cinnamon 6.0.
Please forget about v1.0 and download v1.1.1 below:
no-distraction@drugwash_1.1.1.zip
(7.82 KiB) Downloaded 63 times
EDIT: Project can now be found at GitLab here.
Last edited by Drugwash on Sat Jan 20, 2024 12:01 am, edited 1 time in total.
DaveJones
Level 2
Level 2
Posts: 57
Joined: Tue Sep 20, 2016 7:37 pm

Re: How to reduce opacity of all of the windows/apps in the background?

Post by DaveJones »

Drugwash wrote: Fri Jan 19, 2024 11:22 pm My bad, first version was whipped up in a hurry and is buggy. Forgot about Tweener being replaced by ease in Cinnamon 5+, and also some variables were mixed up.

In the mean time I managed to launch a 21.2 virtual machine, upgraded to 21.3 and tested this extension. Fixed it properly for Cinnamon 6.0.
Please forget about v1.0 and download v1.1.1 below:

no-distraction@drugwash_1.1.1.zip
THANK YOU so much! I use 6.0.4 and it works great! Way better than the hack I attempted above. It also works with all themes! This extensions should be in the main repo... it's so great!
Thanks again!
DaveJones
Level 2
Level 2
Posts: 57
Joined: Tue Sep 20, 2016 7:37 pm

Re: How to reduce opacity of all of the windows/apps in the background?

Post by DaveJones »

Oh, and it has pretty sweet settings too!
Attachments
Screenshot at 2024-01-19 22-57-01.png
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: How to reduce opacity of all of the windows/apps in the background?

Post by Drugwash »

Glad it works and you like it. :)

As for the official repository... I used to own a GitHub account but they stretched too much asking for 2FA which is a no-no for me, so I deleted that account. As such I cannot publish anything in the main repository. Did add it to my Linux GitLab group though.
Anyone is free to fork the project and add it to main repo if they feel they can maintain it in a timely fashion. :wink:
User avatar
JoanTheSpark
Level 1
Level 1
Posts: 30
Joined: Mon Jun 05, 2023 1:48 am

Re: How to reduce opacity of all of the windows/apps in the background?

Post by JoanTheSpark »

DaveJones wrote: Fri Jan 19, 2024 11:49 pmWay better than the hack I attempted above.
The "hack" does nothing else, it's just direct, manually and not as convenient.. but your convenience and blissfulness got bought with Drugwash's time and knowledge to put together a GUI that does the very same thing, while it's future functionality requires upkeep that might not materialize and you're back to square one.

So I highly recommend to at least look at the code to understand how it's done so you can maintain it - in case this fails:
DaveJones wrote: Fri Jan 19, 2024 11:49 pmThis extensions should be in the main repo... it's so great!
JFYI - most KDE plasma DE's come with stuff like this (and more) out of the box..
DaveJones
Level 2
Level 2
Posts: 57
Joined: Tue Sep 20, 2016 7:37 pm

Re: How to reduce opacity of all of the windows/apps in the background?

Post by DaveJones »

Drugwash wrote: Sat Jan 20, 2024 12:05 am Glad it works and you like it. :)

As for the official repository... I used to own a GitHub account but they stretched too much asking for 2FA which is a no-no for me, so I deleted that account. As such I cannot publish anything in the main repository. Did add it to my Linux GitLab group though.
Anyone is free to fork the project and add it to main repo if they feel they can maintain it in a timely fashion. :wink:
I have been using this for the past 2 months. It's so great! Only issues is that if you have few windows overlaid on top of each other, transparency calculations sometimes flicker (could be graphics driver issues).
I have a suggestion but I'm not sure if it's possible to implement with Cinnamon... is it possible to just "darken" the windows without using the transparency? That would lighten the load on the graphics card.

Thank you so much for this!!
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: How to reduce opacity of all of the windows/apps in the background?

Post by Drugwash »

Yes it's possible. Actually I have here a new version that allows much more effects selectable at will. I've been delaying its publication due to one single feature missing that I can't just find out how to implement and there seems to be no help available. Guess will just have to publish it as is, and if/when that feature will become available will update the code.

Please stand by, will notify when new version is up.
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: How to reduce opacity of all of the windows/apps in the background?

Post by Drugwash »

OK, version 1.2.1 is up at the new Codeberg repository. GitLab are much too inept with their retarded web interface to be of any use. That place will remain simply as a backup for the current versions as they are now.
Codeberg offer an interface very similar to that of GitHub so people used to the latter should feel more at home there.

Here's the link: No Distraction v1.2.1

You may also wanna try other Spices or apps while there.

Enjoy! :)
Screenshot from 2024-03-24 06-23-27.png
DaveJones
Level 2
Level 2
Posts: 57
Joined: Tue Sep 20, 2016 7:37 pm

Re: How to reduce opacity of all of the windows/apps in the background?

Post by DaveJones »

Drugwash wrote: Sun Mar 24, 2024 12:20 am OK, version 1.2.1 is up at the new Codeberg repository. GitLab are much too inept with their retarded web interface to be of any use. That place will remain simply as a backup for the current versions as they are now.
Codeberg offer an interface very similar to that of GitHub so people used to the latter should feel more at home there.

Here's the link: No Distraction v1.2.1

You may also wanna try other Spices or apps while there.

Enjoy! :)
Screenshot from 2024-03-24 06-23-27.png
Absolutely amazing! Using it now! Thank you so much!!!
User avatar
Drugwash
Level 5
Level 5
Posts: 734
Joined: Fri Jun 07, 2019 6:40 am
Location: Ploieşti, RO
Contact:

Re: How to reduce opacity of all of the windows/apps in the background?

Post by Drugwash »

DaveJones wrote: Mon Apr 22, 2024 9:10 pm Absolutely amazing! Using it now! Thank you so much!!!
Kind thanks for your appreciation. Enjoy. :)
Post Reply

Return to “Themes, Icons & Wallpaper”