Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude opacity for specific programs #450

Open
ghost opened this issue Oct 15, 2017 · 16 comments
Open

Exclude opacity for specific programs #450

ghost opened this issue Oct 15, 2017 · 16 comments

Comments

@ghost
Copy link

ghost commented Oct 15, 2017

There are multiple options to exclude specific behaviors (shadows, fade effects, etc) but there's nothing for the opacity. How can I disable opacity (setting it to 1.00) for specific programs?

@0x041E
Copy link

0x041E commented Oct 15, 2017

There already is option called opacity-rule with which you can set opacity for certain program for example opacity-rule = [ "80:class_g = 'URxvt'" ]; would set windows with class URxvt to 80% opacity just replace it with any value you need and it should work

@ghost
Copy link
Author

ghost commented Oct 16, 2017

My bad! I guess it didn't work at first because I didn't enter a XX: value before the class.. How is that there are empty rules ( ex: fade-exclude = [ ]; ) for whatever-rule but not for opacity?

@ghost
Copy link
Author

ghost commented Oct 17, 2017

I'm sorry but it looks like 1) I can't have a 100% opacity and B) I have fullscreen videos still transparent..

@0x041E
Copy link

0x041E commented Oct 17, 2017

The first part i'm not sure why 100 doesn't work maybe 99 might be enough but for the second part depending on browser i remember that at least firefox creates window with different classname for fullscreen i think it was either "plugin-container" or "Navigator" as classname but not sure right now(you can check that yourself with xprop) so you could set that to always be focused or the opacity rule should work

@slackhead
Copy link

I can't seem to get opacity-rule to work. I take it that it goes in ~/.config/compton.conf? This is what I used:

opacity-rule = [ "100:class_g = 'Smplayer'" ];

This is what xprop outputs:

WM_CLASS(STRING) = "smplayer", "Smplayer"

I've tried both strings, but I can't seem to stop smplayer going slightly transparent. Same for mplayer.

Any ideas?

@slackhead
Copy link

Ok I found the reason. Compton needed to be started via dbus-launch.

@ghost
Copy link
Author

ghost commented Nov 11, 2017

@slackhead can you explain what did you do? 100 opacity isn't working for me

@slackhead
Copy link

slackhead commented Nov 11, 2017

In your WM startup file you must use:

dbus-launch compton (options) &

That works for i3. I haven't tried it in fluxbox yet, but I'm sure that it will. If you use something like XFCE, Gnome or KDE you'll have to find a way to launch it like that.

I hope that helps.

@ghost
Copy link
Author

ghost commented Nov 11, 2017

I used exec_always dbus-launch compton -CG --config ~/.config/compton.conf & in my i3 config file and it launches compton but it ignores somehow the 100 value. it works only until 99, if there's 100 it simply ignores the line.. Can't tell why it behaves like this (I'm using arch and i3wm btw)

@slackhead
Copy link

Yeah, you're right. I checked again and it does ignore 100%. 99% seems to = 100 opacity, or as near as I can tell.

I used compton-conf to set everything to 1.0 by default, which does work. My remark about using dbus-launch was more to do with making windows fully opaque, because some were semi-transparent without dbus.

@ghost
Copy link
Author

ghost commented Nov 11, 2017

I compromised making every window fully opaque by default and setting custom opacity via opacity-rule for all the programs I want to be transparent. The only problem I have here is that compton makes lemonbar fully transparent somehow but nobody answered my issue about that for a month. Maybe one day.. Thanks anyway you made me rethink how I was setting compton and now I almost have the configuration I wanted!

@slackhead
Copy link

If you can find the window class for lemonbar you might be able to fix it.

@ghost
Copy link
Author

ghost commented Nov 11, 2017

it looks like it ignores it. the class is Bar but no matter what I enter it doesn't affect it anyway

@cesalazar
Copy link

I was able to achieve 100% opacity for Firefox by setting active-opacity = 1; (I don't want transparency by default) and not including Firefox on opacity-rule. Then restarted both compton and i3 for the change to be applied.

Restarting compton alone didn't reset the opacity for the running instance of Firefox.

llitz added a commit to llitz/compton that referenced this issue Aug 10, 2018
When inactive-opacity is enabled, you can override the opacity by using opacity-rule.

By default, all windows have 100 opacity and, if it is still at 100,
inactive-opacity will be applied when the window loses focus. This
patch adds a new bool opacity_disabled to win struct and verify this
variable before deciding if it should be excluded from inactive-opacity

Fix 99% transparency problems on chjj/compton#450 chjj/compton#433
chjj/compton#403 chjj/compton#367 chjj/compton#260 chjj/compton#182
chjj/compton#158
llitz added a commit to llitz/compton that referenced this issue Aug 10, 2018
When inactive-opacity is enabled, you can override the opacity by using opacity-rule.

By default, all windows have 100 opacity and, if it is still at 100,
inactive-opacity will be applied when the window loses focus. This
patch adds a new bool opacity_disabled to win struct and verify this
variable before deciding if it should be excluded from inactive-opacity

Fix 99% transparency problems on chjj/compton#450 chjj/compton#433
chjj/compton#403 chjj/compton#367 chjj/compton#260 chjj/compton#182
chjj/compton#158
@yshui
Copy link

yshui commented Aug 11, 2018

Hello, I had an attempt at fixing this problem, by allowing setting opacity to 100 with rules. If you could give yshui/picom@30c14c0 (i.e. the opacity branch) a try, and report back, that will be much appreciated.

@dekonnection
Copy link

Hello, I had an attempt at fixing this problem, by allowing setting opacity to 100 with rules. If you could give yshui/compton@30c14c0 (i.e. the opacity branch) a try, and report back, that will be much appreciated.

Can confirm, the fix is working for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants