Closed ghost closed 10 years ago
The method is right, but the format is wrong: You incorrectly wrapped "dock = ..." inside "tooltip = { ... }". Fix:
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.75;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
dock =
{
opacity = 0.6;
};
};
Ahh richardgv you Da MAN! :)
With i3 I can only run conky with these either of these two options;
own_window_type dock
own_window_type panel
But using either one these above, the opacity option is also affecting conky, so how can I exclude conky in compton?
Also Richard, have you ever used i3? I was hoping the part of the statusbar in the middle that appears black would be all that might change, but everything in the stausbar changes, the clock, tray icons, the numbers that desginate which desktop you are in etc...
Thank you very much! :)
Just remove the dock opacity rule and use --opacity-rule 'window_type = "dock" && class_g = "i3bar"'
instead, if you want accurate matching.
Also Richard, have you ever used i3? I was hoping the part of the statusbar in the middle that appears black would be all that might change, but everything in the stausbar changes, the clock, tray icons, the numbers that desginate which desktop you are in etc...
Nope, I don't use the WM. (Actually I got a negative impression of i3 in the past because of how it drew its window frame.)
I'm not really sure what you meant. Did you mean you want a part of i3bar window be transparent while the rest stay opaque? That's not possible presently because compton operates on top-level windows and the whole i3bar is one window. It would be possible (but very tricky) to achieve it if you know the transparent region somehow. Hacking i3bar's source code might be a better direction.
You can always create a rule like this in the ~/.i3/conf to remove the border and title bar;
for_window [class="VirtualBox"] floating enable border pixel 1
Sorry if I remove the opacity rule I now have at the bottom of the config, how can I control the level of opacity I want?
I do everything also in my config file not from the cli, so how can I write that here?
opacity-rule = [ "99:class_g = 'Firefox' && window_type = 'tooltip'" ];
thanks again...
Sorry, I forgot the "60:" part... So just use:
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'",
"60:window_type = 'dock' && class_g = 'i3bar'"
];
You can always create a rule like this in the ~/.i3/conf to remove the border and title bar;
Actually that's not the problem... I'm talking about this issue:
https://github.com/chjj/compton/wiki/faq#3-why-does-transparency-not-work-correctly-in-i3
Hi richardgv,
Sorry you lost me, what is the link for, to create a rule for what?
This isn't working;
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'",
"60:window_type = 'dock' && class_g = 'i3bar'"
];
When I log out I get this in the terminal;
"99:class_g = 'Firefox' && window_type = 'tooltip'", "60:window_type = 'dock' && class_g = 'i3bar'" pos 46: Unexpected Expression
Thanks
Hi,
I''ve been digging around in man and online for the past few days and Ive not been able to come up with anything on this. Are there really docs for compton that clearly and easily define how to to do this? Because I'm not seeing anything...
Wouldn't this be a lot easier if compton simply had a --opacity-exclude
?
Thank you
Repeat: The correct rule to make i3bar (and only i3bar) transparent, when written in your configuration file, is:
opacity-rule = [
"60:window_type = 'dock' && class_g = 'i3bar'"
];
And the correct form when you want to specify it through commandline switches instead of in your configuration file is:
compton --opacity-rule '60:window_type = "dock" && class_g = "i3bar"'
It works here, with compton-git-v0.1_beta2-30-g81c677f-2014-05-16
and 0.1_beta2
.
Please firstly make sure you have a sufficiently recent version of compton (>=0.1beta2). For some reasons the two separate rules are "joined" in your case. The most possible reason you see the error is you failed to specify the rule correctly. You could copy these lines to an empty file (don't put anything else in it)_ and use the file as configuration file (compton --config /path/to/the/file
), to test if it actually works on your side. Show us your whole configuration file after the modification if you still have the problem.
Are there really docs for compton that clearly and easily define how to to do this? Because I'm not seeing anything...
Our man page is a reference, not a tutorial. We talk about methods to satisfy your needs, but we usually won't write how to do one specific thing (unless it's really really common). And yes, that could be a bad approach, but I'm afraid you can't expect me to write too much when I don't even have the time to answer your questions.
Wouldn't this be a lot easier if compton simply had a
--opacity-exclude
?
Sorry, I don't have an idea what you are trying to indicate.
Sorry you lost me, what is the link for, to create a rule for what?
"You can always create a rule like this in..." is the sentence you said above and I just quoted it... Though that's irrelevant here. Just ignore those things for now.
Hi,
This isn't working, I'm getting that same message.
If I comment out firefox like this it works;
opacity-rule = [
"60:window_type = 'dock' && class_g = 'i3bar'" ];
I noticed any new rule I add after firefox as you say are becoming joined....
So if Firefox is commented out it works as far as making the i3bar tranparent, but I thought this is only for the i3bar transparency? Conky is still getting transparent...
I meant to have a rule --opacity-exclude
so we could easily exclude something.
I just cloned from your git repo today, so I guess it doesn't get any newer then that, hehe... :)
I actually ran this from my .xinitrc and when I logged into my WM and conky was not transparent, only the i3bar.
compton --opacity-rule "99:class_g = 'Conky'" --config ~/.config/compton -b --logpath /tmp/compton.log &
On the man and docs ok, errrr now I feel bad, you don't have time to answer questions, so I REALLY DO APPRECIATE this help! :)
This is my config file;
#################################
#
# Shadows
#
#################################
# Enabled client-side shadows on windows.
shadow = true;
# Don't draw shadows on DND windows.
no-dnd-shadow = true;
# Avoid drawing shadows on dock/panel windows.
no-dock-shadow = true;
# Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows. (Disable for xfce4-notifyd popups)
clear-shadow = true;
# The blur radius for shadows. (default 12)
shadow-radius = 7;
# The left offset for shadows. (default -15)
shadow-offset-x = -7;
# The top offset for shadows. (default -15)
shadow-offset-y = -7;
# The translucency for shadows. (default .75)
shadow-opacity = 0.9;
# Set if you want different colour shadows
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws
# its shadows, certain applications will have visual glitches
# (most applications are fine, only apps that do weird things with xshapes or argb are affected).
# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes
# shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher.
shadow-exclude = [
"name = 'Notification'",
"name *= 'compton'",
"class_g = 'Conky'",
"class_g = 'Firefox'"
];
# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners)
shadow-ignore-shaped = false;
#################################
#
# Opacity
#
#################################
menu-opacity = 1;
inactive-opacity = 1;
active-opacity = 1;
frame-opacity = 0.9;
inactive-opacity-override = false;
alpha-step = 0.06;
# What is this for?
#blur-kern = "3x3box"
# Dim inactive windows. (0.0 - 1.0)
# inactive-dim = 0.2;
# Do not let dimness adjust based on window opacity.
# inactive-dim-fixed = true;
# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred.
# blur-background = true;
# Blur background of opaque windows with transparent frames as well.
# blur-background-frame = true;
# Do not let blur radius adjust based on window opacity.
blur-background-fixed = false;
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'"
];
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'"
"60:window_type = 'dock' && class_g = 'i3bar'"
];
#################################
#
# Fading
#
#################################
# Fade windows during opacity changes.
fading = true;
# The time between steps in a fade in milliseconds. (default 10).
fade-delta = 4;
# Opacity change between steps while fading in. (default 0.028).
fade-in-step = 0.03;
# Opacity change between steps while fading out. (default 0.03).
fade-out-step = 0.03;
# Fade windows in/out when opening/closing
#no-fading-openclose = true;
# Specify a list of conditions of windows that should not be faded.
fade-exclude = [
"class_g = 'Firefox'",
"class_g = 'Geany'",
"class_g = 'Gimp-2.8'",
"class_g = 'XTerm'",
"class_g = 'URxvt'",
"class_g = 'Dmenu'"
];
#################################
#
# Other
#
#################################
# Try to detect WM windows and mark them as active.
mark-wmwin-focused = true;
# Mark all non-WM but override-redirect windows active (e.g. menus).
mark-ovredir-focused = true;
# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events.
# Usually more reliable but depends on a EWMH-compliant WM.
use-ewmh-active-win = true;
# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-rounded-corners = true;
# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of
# client windows to frame windows. This prevents opacity being ignored for some apps.
# For example without this enabled my xfce4-notifyd is 100% opacity no matter what.
detect-client-opacity = true;
# Specify refresh rate of the screen.
# If not specified or 0, compton will try detecting this with X RandR extension.
refresh-rate = 0;
# Set VSync method. VSync methods currently available:
# none: No VSync
# drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers.
# opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers.
# opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers.
# opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only
# with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing,
# only buffer swap is affected, so it doesn't have the effect of --sw-opti unlike other methods. Experimental.
# opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above,
# except the extension we use. (Note some VSync methods may not be enabled at compile time.)
# vsync = "opengl-swc";
#vsync = "none";
vsync = "opengl";
# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing.
# Reported to have no effect, though.
# dbe = true;
# Painting on X Composite overlay window. Recommended.
paint-on-overlay = true;
# Limit compton to repaint at most once every 1 / refresh_rate second to boost performance.
# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already,
# unless you wish to specify a lower refresh rate than the actual value.
sw-opti = false;
# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen
# windows, like games. Known to cause flickering when redirecting/unredirecting windows.
# paint-on-overlay may make the flickering less obvious.
unredir-if-possible = true;
# Specify a list of conditions of windows that should always be considered focused.
focus-exclude = [
"class_g = 'Firefox'",
"class_g = 'XTerm'"
];
# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time.
detect-transient = true;
# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time.
# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too.
detect-client-leader = true;
# What is this for?
invert-color-include = [ ];
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
xrender-sync-fence = true;
#################################
#
# GLX backend
#
#################################
glx-no-stencil = true;
# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all.
# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is
# modified, but a 20% increase when only 1/4 is. My tests on nouveau show terrible slowdown.
# Useful with --glx-swap-method, as well.
glx-copy-from-front = false;
# GLX backend: Use MESA_copy_sub_buffer to do partial screen update. My tests on nouveau
# shows a 200% performance boost when only 1/4 of the screen is updated. May break VSync
# and is not available on some drivers. Overrides --glx-copy-from-front.
# glx-use-copysubbuffermesa = true;
# GLX backend: Avoid rebinding pixmap on window damage. Probably could improve performance
# on rapid window content changes, but is known to break things on some drivers (LLVMpipe).
# Recommended if it works.
# glx-no-rebind-pixmap = true;
# GLX backend: GLX buffer swap method we assume.
# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1).
# undefined is the slowest and the safest, and the default value.
# copy is fastest, but may fail on some drivers,
# 2-6 are gradually slower but safer (6 is still faster than 0).
# Usually, double buffer means 2, triple buffer means 3.
# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers.
# Useless with --glx-use-copysubbuffermesa.
# Partially breaks --resize-damage.
# Defaults to undefined.
glx-swap-method = "undefined";
#################################
#
# i3 settings
#
#################################
#new_window pixel
#################################
#
# Window type settings
#
#################################
wintypes:
{
tooltip =
{
# fade: Fade the particular type of windows.
fade = true;
# shadow: Give those windows shadow
shadow = false;
# opacity: Default opacity for the type of windows.
opacity = 0.75;
# focus: Whether to always consider windows of this type focused.
focus = true;
};
dock =
{
opacity = 0.5;
};
};
This isn't working, I'm getting that same message.
If I comment out firefox like this it works;
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'"
"60:window_type = 'dock' && class_g = 'i3bar'"
];
I noticed any new rule I add after firefox as you say are becoming joined....
Seemingly the reason it failed is you missed the comma on the end of the Firefox rule line.
So if Firefox is commented out it works as far as making the i3bar tranparent, but I thought this is only for the i3bar transparency? Conky is still getting transparent... I meant to have a rule
--opacity-exclude
so we could easily exclude something.
Please reread what I said in the previous comment:
Just remove the dock opacity rule and use ...
So I have told you to remove the dock opacity rule and apparently you ignored it.
By the way, in case you don't really remember which "dock opacity rule" I were talking about, it's these lines on the bottom of the your configuration file.
dock =
{
opacity = 0.5;
};
On the man and docs ok, errrr now I feel bad, you don't have time to answer questions, so I REALLY DO APPRECIATE this help! :)
I'm glad that you could understand it. :-) I really miss the days when I don't have to spend so much time on my work. :-D
Ahh sorry I missed the comma... :(
"60:window_type = 'dock' && class_g = 'i3bar'"
Is this including or excluding?
dock = opacity = 0.5;
helps me to control opacity levels...
I left dock = opacity = 0.5;
rule and this below for conky which seems to be excluding it from opactity which is what I want.
opacity-rule = [ "99:class_g = 'Firefox' && window_type = 'tooltip'", "99:class_g = 'Conky'" ];
Is this including or excluding?
It's including. Read the man page for more details.
--opacity-rule OPACITY:'CONDITION'
Specify a list of opacity rules, in the format PERCENT:PATTERN, like 50:name *=
"Firefox". compton-trans is recommended over this. Note we do not distinguish
100% and unset, and we don’t make any guarantee about possible conflicts with
other programs that set _NET_WM_WINDOW_OPACITY on frame or client windows.
I left
dock = opacity = 0.5;
rule and this below for conky which seems to be excluding it from opactity which is what I want.
Alright, just leave it that way, then.
Hi richardgv,
I used a different git account last year and you showed me this rule for Firefox to exclude opacity on the firefox tooltips, so when I saw this, I assumed this is for excluding.
"99:class_g = 'Firefox' && window_type = 'tooltip'",
So depending on how you wrtie the rule it will either include or exclude opacity, then how do you make the rules to do both? The onlly thing different I see here is the number for the class, 99 & 60?
So I wanted to exclude Conky, is this a correct rule to use?
"99:class_g = 'Conky'"
Thank you again for your time!
@moulei:
So depending on how you wrtie the rule it will either include or exclude opacity, then how do you make the rules to do both? The onlly thing different I see here is the number for the class, 99 & 60?
... Haven't I already quoted the relevant man page section for you in the previous reply?
99:SOME_CONDITION
means windows that could satisfy the given condition will be set to 99% opaque (100:SOME_CONDITION
doesn't work in the way you may expect), so it's effectively "excluding" opacity. 60:SOME_CONDITION
means the matched windows are set to 60% opaque.
So I wanted to exclude Conky, is this a correct rule to use?
"99:class_g = 'Conky'"
Yes, although not too optimal. --opaque-rule
could lead to conflicts in some cases, as stated in the man page, and it's recommended that you stay away from it unless absolutely necessary.
Ahh ok...
Sorry if you mentioned this before, how would you recommend excluding conky?
thanks again for your time! :)
Sorry if you mentioned this before, how would you recommend excluding conky?
Use a stricter --opacity-rule
rule to add opacity to windows, like --opacity-rule '60:window_type = "dock" && class_g = "i3bar"'
or --opacity-rule '60:window_type = "dock" && !class_g = "Conky"'
. It's the best exclusion if you don't match it in the first place.
Sorry you're still confusing me, because last year you showed me how to exclude the tooltip for Firefox like below;
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'",
"60:window_type = 'dock' && !class_g = 'Conky'"
];
So I added in this new rule for conky but it doesn't work, conky still is getting transparent.
So then I made it like this and it works;
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'",
"99:class_g = 'Conky' && window_type = 'dock'"
];
So why would you have me write a rule one way to exclude like firefox and then have me write it a different way for another app?
Based on what you taught me before for firefox, then why wouldn't all rules follow the same pattern for the config file like below?
"xx:class_g = 'app' && window_type = 'option'"
So I added in this new rule for conky but it doesn't work, conky still is getting transparent.
Have you removed those lines I mentioned above from your configuration file?
dock =
{
opacity = 0.5;
};
Those lines could make all dock windows transparent.
Another reason that could lead to the effect is the "persistent" effect of --opacity-rule
, discussed below.
So why would you have me write a rule one way to exclude like firefox and then have me write it a different way for another app?
Let me re-explain all the mechanisms of calculating window opacity in compton. But I probably won't have more time to explain things to you in the future. When in doubt, consult the man page.
A window's opacity could be determined by severals factors, in the order of priority:
_NET_WM_WINDOW_OPACITY
property on direct children of root window, if it's not set to 0xFFFFFFFF
(aka fully opaque). Usually, the client application sets this property on its window, and (some) WMs copies the property to the frame window it creates, which (usually) becomes a direct child of root window._NET_WM_WINDOW_OPACITY
on client window, if --detect-client-opacity
is enabled and it's not 0xFFFFFFFF
. This is a workaround for some WMs that don't copy the _NET_WM_WINDOW_OPACITY
property.wintypes:
section of your configuration file for the given window type, if it's not 1.0
(fully opaque). -m
/menu-opacity
is equvalent to a wintypes:
rule.--opacity-exclude
, --mark-ovredir-focused
, and --mark-wmwin-focused
may affect this), value of -i
or inactive_opacity
. (Note that one special case is, when --inactive-opacity-override
is enabled, this rule has the highest priority.)--focus-exclude
, etc.), the value of --active-opacity
.Special case: Compton usually ignores changes to opacity rules on unmapped/destroyed windows.
When rules with higher priority don't apply to a window, compton tries to find matched rules with lower priority. When no rules apply, the window is rendered fully opaque.
All other methods/settings to set opacity will only affect compton itself, except --opacity-rule
, which actually sets _NET_WM_WINDOW_OPACITY
on the matched top-level window. --opacity-rule
permanently sets the property on the window, so that even if compton is killed, and you started another compositor (or just restarted compton), its effect persists before the property is modified again.
The basic idea is, opacity-rule
has a high priority (only lower than inactive-opacity
if inactive-opacity-override
is enabled, otherwise the highest, unless the application/WM tries to set the opacity), and it modifies _NET_WM_WINDOW_OPACITY
directly, so it may lead to conflicts (when both compton and the application/WM try to set the property) and therefore must be applied to as few windows as possible and very carefully.
This works...
opacity-rule = [
"99:class_g = 'Firefox' && window_type = 'tooltip'",
"99:class_g = 'Conky' && window_type = 'dock'"
];
And this allows me to change the opactiy level on the i3bar
dock =
{
opacity = 0.5;
};
Beyond doing anything else, I'm not getting it, so I'll just have to leave it as. This works, it does what I want, so not sure how that can be a bad thing...
thanks again for all your help
Oh, okay...
Hi,
I'm using i3 and have been told you can make the statusbar transparent with compton, this is what I saw as an option to add to compton;
This is how I have it at the bottom of my compton.conf but I can't seem to make it work, would you know how to make the statusbar transparent with compton?
THANKS