SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-04-10 21:21:37

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,963

Things to know when rolling through Compton: Your compton configs

Having always liked the border shadows and mosaic plugin and various things in cairo-compmgr, it took me a while to switch over to compton. Eventually though I got sick of the vertical tearing when doing things as menial as scrolling through a web page. After getting into the compton config files, I realized that there's actually a lot more customization to be done in compton than cairo-compmgr, it just uses a text file instead of the tray plugin. There's also a few quirks, like getting compton to draw shadows on everything but conky. I spent a couple hours tweaking around with things and here's what I ended up with:

  • This entry in .config/openbox/autostart.sh:

compton --config ~/.compton.conf --shadow-exclude 'n:a:Conky' -b &
  • This config in ~/.compton.conf:

# Shadow
shadow = true;			# Enabled client-side shadows on windows.
no-dock-shadow = true;		# Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true;		# Don't draw shadows on DND windows.
clear-shadow = true;		# Zero the part of the shadow's mask behind the window (experimental).
shadow-radius = 7;		# The blur radius for shadows. (default 12)
shadow-offset-x = -7;		# The left offset for shadows. (default -15)
shadow-offset-y = -7;		# The top offset for shadows. (default -15)
# shadow-opacity = 0.7;		# The translucency for shadows. (default .75)
# shadow-red = 0.0;		# Red color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-green = 0.0;		# Green color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-blue = 0.0;		# Blue color value of shadow. (0.0 - 1.0, defaults to 0)
shadow-exclude = [ "n:e:Notification" ];	# Exclude conditions for shadows.
# shadow-exclude = "n:e:Notification";
shadow-ignore-shaped = true;

# Opacity
menu-opacity = 0.9;			# The opacity for menus. (default 1.0)
inactive-opacity = 0.9;			# Opacity of inactive windows. (0.1 - 1.0)
#frame-opacity = 0.8;			# Opacity of window titlebars and borders. (0.1 - 1.0)
inactive-opacity-override = true;	# Inactive opacity set by 'inactive-opacity' overrides value of _NET_WM_OPACITY.

# Fading
fading = true;			# Fade windows during opacity changes.
# fade-delta = 30;		# The time between steps in a fade in milliseconds. (default 10).
fade-in-step = 0.03;		# Opacity change between steps while fading in. (default 0.028).
fade-out-step = 0.03;		# Opacity change between steps while fading out. (default 0.03).
# no-fading-openclose = true;	# Fade windows in/out when opening/closing.

# Other
#inactive-dim = 0.5;		# Dim inactive windows. (0.0 - 1.0, defaults to 0).
mark-wmwin-focused = true;	# Try to detect WM windows and mark them as active.
mark-ovredir-focused = true;
detect-rounded-corners = true;

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = false; opacity = 0.75; };
};


##excluded apps
#shadow-exclude = [ "g:si:Conky" ];
  • These settings at the beggining of my conky config:

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class Conky
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
  • These two scripts to start smplayer and disable compton until you close smplayer:

  1. ~/bin/no-comp.sh:

    #!/bin/bash
    # a little script to disable compton compositer, if it is running, when executing a
    # program.
    
    if [ -z "$(pgrep compton)" ]
        then
            $*
        else
            killall compton
            $*
            compton --config ~/.compton.conf --shadow-exclude 'n:a:Conky' -b &
    fi
    exit
  2. ~/bin/smpnocomp.sh

    #!/bin/bash
    ##disables compton when mplayer starts then re-enables it upon exit
    bash no-comp.sh smplayer2

More on the compton config: This will give you subtle shadows on everything but conky and tint2 (but you will still have a transparent tint2). This even includes dmenu, obmenu, and everything else I've encountered so far. Any window that doesn't have the focus will be slightly transparent. There is a fade in and fade out effect on everything that is so slick looking it will have even the most zealous macbook toting hipsters jealous. This does add an extra millisecond or so before you can look at an item you recently opened and interact with it, but IMO if you aren't looking for bling, stay in your terminal  devil
Just thought I'd share this with you all since compton is the default compositor in #!. This was all set up with the most recent conky and compton in the AUR, so the configs might have to be altered somewhat to make it work right, but you should be fine. If anyone else has some compton related tricks or configs of your own, feel free to share!

Last edited by mynis01 (2013-04-10 21:22:18)

Offline

Be excellent to each other!

#2 2013-04-10 22:03:39

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,106

Re: Things to know when rolling through Compton: Your compton configs

Thanks for this mynis!

Offline

#3 2013-04-11 09:54:50

RichardGv
#! Member
From: People's Republic of China
Registered: 2013-01-13
Posts: 52

Re: Things to know when rolling through Compton: Your compton configs

Thanks, this looks interesting!

mynis01 wrote:

Having always liked the border shadows and mosaic plugin and various things in cairo-compmgr...

Not exactly sure about what "border shadow" indicates. You could simulate the mosaic plugin with skippy-xd or skippy.

mynis01 wrote:

... --shadow-exclude 'n:a:Conky' ...

You could integrate this switch to compton.conf:

# To specify multiple shadow-exclude entries, just use a comma
shadow-exclude = [ "n:e:Notification", "n:e:Conky" ];

compton uses libconfig to parse configuration files, so in case there's any problem about the syntax, you could look into the libconfig manual.

By the way, your compton configuration somehow looks pretty old, lack of a lot of options, and doesn't look like what comes with the "most recent ... compton in the AUR".

mynis01 wrote:

These two scripts to start smplayer and disable compton until you close smplayer...

Oh, just wonder why you would disable compton when smplayer is running: Tearing, performance issue, or something else?

compton's --unredir-if-possible disables compositing when there's a full-screen window automatically, if your problem only happens with full-screen video playback.

Offline

#4 2013-04-12 08:51:31

Bradi
#! CrunchBanger
From: Poland
Registered: 2013-01-21
Posts: 114

Re: Things to know when rolling through Compton: Your compton configs

Thanks for the miniguide, mynis01, compton is somewhat underdocumented.
The fades and shadows are buggy for me, so I only use the transparency effects. Seems like some of the bugs have been corrected in the newest release, but I'm not going through the trouble of manually updating for some gratuituous eyecandy smile

Offline

#5 2013-04-19 17:12:52

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,963

Re: Things to know when rolling through Compton: Your compton configs

I changed my compton line in autostart.sh to

compton --config ~/.compton.conf --backend glx --vsync opengl-swc --shadow-exclude 'n:a:Conky' -b &

Now I don't need to kill compton when starting smplayer. Tearing is less noticeable during web browsing as well. Thanks for the tips guys!

Offline

#6 2013-05-04 13:55:28

bwat47
New Member
Registered: 2011-12-01
Posts: 7

Re: Things to know when rolling through Compton: Your compton configs

Yeah the latest git versions of compton has very good vsync support for the glx backend. I use this on my intel machine:

compton --backend glx --paint-on-overlay --glx-no-stencil --glx-no-rebind-pixmap --vsync opengl-swc --shadow-exclude "! name~=''" --config ~/.compton.conf -b &

Totally removes tearing for me in windowed and in fullscreen, and even with multiple displays big_smile

And I use this for my config, pretty much the same as OP but I added more shadow exclusions for apps that I found to not behave well with compton's shadows:

# Shadow
shadow = true; # Enabled client-side shadows on windows.
no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true; # Don't draw shadows on DND windows.
clear-shadow = true; # Zero the part of the shadow's mask behind the window (experimental).
shadow-radius = 7; # The blur radius for shadows. (default 12)
shadow-offset-x = -7; # The left offset for shadows. (default -15)
shadow-offset-y = -7; # The top offset for shadows. (default -15)
shadow-exclude = [ "n:e:Notification", "g:e:Synapse", "g:e:Conky", "n:w:*Firefox*", "n:w:*Chromium*", "class_g ?= 'Xfce4-notifyd'", "class_g ?= 'Xfce4-power-manager'"];

# Fading
#fading = true; # Fade windows during opacity changes.
#fade-delta = 5; # The time between steps in a fade in milliseconds. (default 10).
#fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028).
#fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03).
# no-fading-openclose = true; # Fade windows in/out when opening/closing

#detect-rounded-corners = true;

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = false; };
};

Last edited by bwat47 (2013-05-04 13:57:28)

Offline

#7 2014-02-02 12:12:43

abstract
Member
From: Columbus, Ohio
Registered: 2011-08-03
Posts: 22

Re: Things to know when rolling through Compton: Your compton configs

i think i see now why frame-opacity is commented out:
i installed/use google chrome, and enabling frame-opacity renders it useless. don't know what all else it affects.
any way 'round this? love semi-transparent title bars.

Offline

#8 2014-02-03 00:30:11

RichardGv
#! Member
From: People's Republic of China
Registered: 2013-01-13
Posts: 52

Re: Things to know when rolling through Compton: Your compton configs

abstract wrote:

i think i see now why frame-opacity is commented out:
i installed/use google chrome, and enabling frame-opacity renders it useless. don't know what all else it affects.
any way 'round this? love semi-transparent title bars.

Not sure what your "renders it useless" means. compton with frame-opacity + Chromium works perfectly here, with or without WM borders on Chromium windows.

If compton is incorrectly rendering the border area of your Chrom{e,ium} window semitransparent when it doesn't actually have a WM border, this typically means either: 1. You have an ancient version of compton that it fails to handle changes to `_NET_FRAME_EXTENTS` correctly, or 2. Your WM is broken and sets `_NET_FRAME_EXTENTS` incorrectly on a window without WM border. You could use `xprop` on the Chrom{e,ium} window to figure out if `_NET_FRAME_EXTENTS` is correct. For the first case, you need to upgrade compton, to at least 0.1_beta2; for the second case, you could:

  1. Enable "Use system title bar and borders" in Chromium settings.

  2. Use a sane WM. (Openbox and fvwm both work correctly here.)

Last edited by RichardGv (2014-02-03 00:56:38)

Offline

#9 2014-02-03 01:28:02

abstract
Member
From: Columbus, Ohio
Registered: 2011-08-03
Posts: 22

Re: Things to know when rolling through Compton: Your compton configs

by useless, i mean only the openbox title bar is visible - minimize, maximize= nothing, can only close it. for the record, i'm using a brand new install of #! Waldorf, and all dist-upgraded, too. i'll try using chrome's title bar decoration.
it's really not a big deal. works perfectly with frame-opacity commented out.
#! is very very nice.

*abstract backs slowly away from the message board*

Offline

#10 2014-02-03 01:41:35

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,183

Re: Things to know when rolling through Compton: Your compton configs

I've encountered this frame-opacity problem in the past as well.  (I normally roll without compositing, but I experiment every now and then.)  You don't have AMD graphics by any chance?  I think this might be GPU-related, but I'm not positive.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#11 2014-02-03 16:12:41

RichardGv
#! Member
From: People's Republic of China
Registered: 2013-01-13
Posts: 52

Re: Things to know when rolling through Compton: Your compton configs

abstract wrote:

by useless, i mean only the openbox title bar is visible - minimize, maximize= nothing, can only close it. for the record, i'm using a brand new install of #! Waldorf, and all dist-upgraded, too. i'll try using chrome's title bar decoration.
it's really not a big deal. works perfectly with frame-opacity commented out.
#! is very very nice.

*abstract backs slowly away from the message board*

Like, all content of the Chromium window is invisible, except the titlebar? Could you please attach a screenshot? Does switching compton's backend help? I was not expecting --frame-opacity to have such effects...

I couldn't reproduce it with compton-git-v0.1_beta2-16-gaeda148-2014-01-21 with compton.sample.conf (which has frame-opacity enabled) and openbox-3.5.2, under X Render or GLX backend.

Offline

#12 2014-02-03 16:43:50

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,183

Re: Things to know when rolling through Compton: Your compton configs

@RichardGv:  What I remember was all maximized windows went completely black except for the Openbox window frame.  I first noticed it with Iceweasel, because that's the only program I usually run maximized, but it happens in all maximized windows.

The version of Compton-git in the Waldorf repo (apparently this is one of the binaries we don't have in Wheezy) is 20121102-2 - does this fit your definition of "ancient"?

Incidentally, I feel I must tip my moderator hat to you and say how much we appreciate the assistance of the Compton developer in this matter.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#13 2014-02-03 19:21:16

photonucleon
Quantum Geek
From: Kashyyyk, Mytaranor sector
Registered: 2013-06-10
Posts: 786

Re: Things to know when rolling through Compton: Your compton configs

Just to say that I've had maximising problems with titlebar transparency in compton; typically the titlebar itself would "maximise" up to the top of the screen, but the actual content of the window would remain the same size (and cease to respond).


-I made some music!- -A CrunchBanger's blog- -Enable boot from USB on older computers-
It's another wolf bite, howling in the moonlight; I want to get my life right - will you show me the way?

Offline

#14 2014-02-04 01:12:48

RichardGv
#! Member
From: People's Republic of China
Registered: 2013-01-13
Posts: 52

Re: Things to know when rolling through Compton: Your compton configs

pvsage wrote:

@RichardGv:  What I remember was all maximized windows went completely black except for the Openbox window frame.  I first noticed it with Iceweasel, because that's the only program I usually run maximized, but it happens in all maximized windows.

photonucleon wrote:

Just to say that I've had maximising problems with titlebar transparency in compton; typically the titlebar itself would "maximise" up to the top of the screen, but the actual content of the window would remain the same size (and cease to respond).

Thanks. I see. Can't seem to reproduce it with a recent version of compton. I tried reverting to e912fcd (Nov 19, 2012) and 9ca20e7 (Nov 21, 2012), and there's no problem I could see when testing in Xephyr, either. I'm surprised that I've never noticed similar reports.

pvsage wrote:

The version of Compton-git in the Waldorf repo (apparently this is one of the binaries we don't have in Wheezy) is 20121102-2 - does this fit your definition of "ancient"?

Yes, that looks insanely old for me. You are recommended to grab 0.1_beta2 from Debian sid or git20140121 from my Ubuntu PPA (not sure if Ubuntu packages work for Crunchbang).

If the problem occurs on a sufficiently new version (>= 0.1_beta2), you may wish to check:

  1. Is Chromium becoming completely unresponsive, or just compton not drawing what is inside Chromium window?

  2. Does forcing repaint (like, drag a window around above Chromium) changes anything? Does restarting compton help?

  3. What does `xprop _NET_FRAME_EXTENTS` say about the window with problem?

  4. Does switching `--backend` of compton help?

  5. Does flipping `--paint-on-overlay` help?

pvsage wrote:

Incidentally, I feel I must tip my moderator hat to you and say how much we appreciate the assistance of the Compton developer in this matter.

Thanks! :-) And thank you, too, for help improving compton.

Last edited by RichardGv (2014-02-04 01:18:31)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo