Author Topic: How to enable Compton screen compositor (LXDE)  (Read 6560 times)

Dan

  • Sr. Member
  • ****
  • Posts: 192
    • View Profile
How to enable Compton screen compositor (LXDE)
« on: February 24, 2016, 10:10:05 PM »
If you would like to have Compton on wattOS LXDE, it's quick and easy to install. Compton can provide some screen effects; such as, shadows around windows, windows fading in and out upon open and close, and it also can resolve screen tearing issues. I can't vouch for the screen tearing issues, because I've not experienced them myself, but people do say Compton fixes them.

I've included installation instructions in my configuration file. You have two choices...

1. Open Leafpad. Then copy and paste the the code below into it. Name the file compton.conf when you close and save it. Then follow the instructions included in the file.

...or...

2. Simply download the attached file at the bottom of this post, and follow the instructions.

Here's the code if you want to copy and paste...

Code: [Select]
#################################################################################################
#                                                                                               #
#                               INSTALLATION INSTRUCTIONS                                       #
#                                                                                               #
# Step 1 - Install Compton by opening your terminal, and enter the following command...         #
#                                                                                               #
#          sudo apt-get install compton                                                         #
#                                                                                               #
# Step 2 - Open your File Manager, click the View tab, and click Show Hidden.                   #
#          - Open the .config folder                                                            #
#          - Copy and paste this file into the .config folder.                                  #
#          - Make sure the file is named compton.conf                                           #
#          - You can close the File Manager now if you wish.                                    #
#                                                                                               #
# IMPORTANT! You can now try Compton BEFORE making it permanent. That way, you will see if      #
#            it causes any adverse effects on your system. To try Compton...                    #
#            - Open your menu and click Run.                                                    #
#            - In the window that pops up, type compton (all lower case), and hit Enter.        #
#            - Your screen may reset for a moment and reappear. Now try opening your menu,      #
#              and open some apps; such as, the file manager, terminal, Firefox, etc...         #
#            - If everything is working normally (apart from the expected shadows and fading),  #
#              proceed to Step 3. If you do have any adverse effects, log out of your computer. #
#              When you log back in, everything should return to normal. Remove Compton from    #
#              your system if you wish.                                                         #
#                                                                                               #                                                                                   
# Step 3 - Return to your terminal, and enter the following command...                          #
#                                                                                               #
#          sudo leafpad ~/.config/lxsession/LXDE/autostart                                      #
#                                                                                               #
#          That will open your autostart configuration file. We want Compton to start when      #
#          the computer starts, so simply add the following command to the autostart file...    #
#                                                                                               #
#          @compton                                                                             #
#                                                                                               #
#          Close the file, and save the changes when asked.                                     #
#                                                                                               #
# Step 4 - Log out of your computer, and log back in. Compton should now be actively working.   #
#          You can change the parameters of this file to suit your taste.                       #
#                                                                                               #
#################################################################################################

backend = "glx";
paint-on-overlay = true;
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "opengl-swc";

# These are important. The first one enables the opengl backend. The last one is the vsync method. Depending on the driver you might need to use a different method.
# The other options are smaller performance tweaks that work well in most cases.
# You can find the rest of the options here: https://github.com/chjj/compton/wiki/perf-guide, and here: https://github.com/chjj/compton/wiki/vsync-guide


# 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 = 12; # The blur radius for shadows. (default 12)
shadow-offset-x = -15; # The left offset for shadows. (default -15)
shadow-offset-y = -15; # The top offset for shadows. (default -15)
shadow-exclude = [
 "! name~=''",
 "n:e:Notification",
 "n:e:Plank",
 "n:e:Docky",
 "g:e:Synapse",
 "g:e:Kupfer",
 "g:e:Conky",
 "n:w:*Firefox*",
 "n:w:*Chrome*",
 "n:w:*Chromium*",
 "class_g ?= 'Notify-osd'",
 "class_g ?= 'Cairo-dock'",
 "class_g ?= 'Xfce4-notifyd'",
 "class_g ?= 'Xfce4-power-manager'"
];

# 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.

# 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-client-opacity = true; # This prevents opacity being ignored for some apps. For example without this enabled my xfce4-notifyd is 100% opacity no matter what.

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

« Last Edit: March 01, 2016, 01:05:26 AM by Dan »

leenie

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 234
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #1 on: February 25, 2016, 04:07:27 AM »
Eye candy for wattOS! I am curious how much more ram Compton uses.

blaze

  • wattOS Veteran
  • Sr. Member
  • ****
  • Posts: 441
  • blazing away
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #2 on: February 25, 2016, 04:34:19 PM »
Yes me too. That would be interesting to know. :)
How To Ask Questions The Smart Way; http://www.catb.org/~esr/faqs/smart-questions.html

... and when SOLVED, please edit thread title in first post! :)

Dan

  • Sr. Member
  • ****
  • Posts: 192
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #3 on: February 25, 2016, 04:37:41 PM »
Eye candy for wattOS! I am curious how much more ram Compton uses.

Not much! 14.9 MB in the screenshot...that's with no other windows pulled up. What's strange is, when I have more windows pulled up; thereby causing more shadows, it actually runs less...around 6 - 8 MB.  :o




leenie

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 234
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #4 on: February 25, 2016, 05:14:20 PM »
Nice! I might give it a try. Thank you for posting this.

blaze

  • wattOS Veteran
  • Sr. Member
  • ****
  • Posts: 441
  • blazing away
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #5 on: February 25, 2016, 07:25:42 PM »
Nice share Dan! Thanks :)
How To Ask Questions The Smart Way; http://www.catb.org/~esr/faqs/smart-questions.html

... and when SOLVED, please edit thread title in first post! :)

Dan

  • Sr. Member
  • ****
  • Posts: 192
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #6 on: February 25, 2016, 10:23:04 PM »
Nice! I might give it a try. Thank you for posting this.

Nice share Dan! Thanks :)

 ;)

Dan

  • Sr. Member
  • ****
  • Posts: 192
    • View Profile
Re: How to enable Compton screen compositor (LXDE)
« Reply #7 on: March 01, 2016, 01:08:46 AM »
I edited the configuration file (now included in the opening post and attached file). I forgot to include a step that lets you try Compton (before making it permanent) so that you can see if it possibly has any adverse effects on your system.