Results 1 to 10 of 10

Thread: HOWTO: 1 click Enable/Disable Composite in Xfce

  1. #1
    Join Date
    Apr 2006
    Location
    Brazil
    Beans
    12
    Distro
    Xubuntu 6.06

    HOWTO: 1 click Enable/Disable Composite in Xfce

    Before we start...

    First of all, what is "Composite" and how to get working?
    http://www.ubuntuforums.org/showthread.php?t=75527

    So, why Enable/Disable the Xfce compositor?
    Here I got a problem: When the composite is enabled: 3d acceleration wont works.

    As I want to use 3d acceleration and have nice effects, I found a way to not have both together, but easily switch composite on/off. This post gimme the idea to create this howto.

    Lets begin:

    1. Create a file called composite-on on /usr/bin (you can replace nano with your favorite text editor):

    Code:
    sudo nano /usr/bin/composite-on
    2. Fill that with the following:
    Code:
    #!/bin/bash
    
    killall xfwm4 && xfwm4 --compositor=on &
    exit
    3. Create a second file called composite-off in /usr/bin too (you can replace nano with your favorite text editor):

    Code:
    sudo nano /usr/bin/composite-off
    4. Fill with the following:

    Code:
    #!/bin/bash
    
    killall xfwm4 && xfwm4 --compositor=off &
    exit
    5. Now make then executable:

    Code:
    sudo chmod +x /usr/bin/composite-on /usr/bin/composite-off
    6. Time to 1 click switch, right click on your panel and choose Add New Iten (Dont know if is exactly that, my system is in pt_BR) choose the first option Launcher (dont know exactly again) and then click add.

    You can name it yourself, and choose a nice icon too (the icons I used are attached at the end of the post), just put composite-on in the command option and that will be the turn on icon.

    Do that twice, but in the second put composite-off in the command camp.

    Thats done...

    Now you got an easy on/off switcher for composite in xfce without have to restart X. Hope that this will help someone...

    Tips, questions and comments will be apreciated, thats just my first howto. And sorry for my bad english, I need to pratice it more
    Attached Images Attached Images

  2. #2
    Join Date
    Apr 2006
    Location
    Brazil
    Beans
    12
    Distro
    Xubuntu 6.06

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    any comment?

  3. #3
    Join Date
    Apr 2006
    Beans
    12

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    I was wondering for a while how to disable/enable composite on xfwm...
    Now i can easly switch composite and use opengl apps without that annoying transparency, tank you for this nice how-to.
    Take care.

  4. #4
    Join Date
    Nov 2005
    Beans
    136
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    so now that i have it turned on, how do i activate it's effects?

  5. #5
    Join Date
    Apr 2006
    Location
    Eastern Europe
    Beans
    87
    Distro
    Ubuntu

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    Great work, this is exactly what I was looking for

  6. #6
    Join Date
    Oct 2008
    Beans
    2

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    Quote Originally Posted by Emanuel Felipe View Post
    any comment?
    There is one caveat with your approach. When you disable compositing with the script, xfce-settings-show won't show the composite window to reenable them, they must be reenabled also by script.

    I just found another approach:

    Write a script which parses
    $(HOME)/.config/xfce4/mcs_settings/wmtweaks.xml
    and changes the line
    <option name="Xfwm/UseCompositing" type="int" value="0"/>
    to
    <option name="Xfwm/UseCompositing" type="int" value="1"/>
    or viceversa.

    Then
    killall -USR1 xfce-mcs-manager

    This way you don't end and restart the process, so it should be faster, and xfce-setting-show is not affected, since --compositor=off is never used.

  7. #7
    Join Date
    May 2009
    Location
    NL
    Beans
    3
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    In Xubuntu 10.04 (Lucid Lynx), in Settings / Settings Editor, select 'wfwm4' and 'General / use_compositing', click the 'edit' button, check the 'Enabled' button and click 'Save'.

    Works perfectly for me!

  8. #8
    Join Date
    Oct 2009
    Beans
    2

    Smile Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    Quote Originally Posted by vor0nwe View Post
    In Xubuntu 10.04 (Lucid Lynx), in Settings / Settings Editor, select 'wfwm4' and 'General / use_compositing', click the 'edit' button, check the 'Enabled' button and click 'Save'.

    Works perfectly for me!

    Works for me too. Thanks for this thread all!

  9. #9
    Join Date
    May 2008
    Beans
    25

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    Great solution.
    Composite is awesome, but kill performance in games.

    BTW, you can achieve the same thing (at least in Xubuntu 12.04) with those commands:

    xfwm4 --compositor=on --replace &
    xfwm4 --compositor=off --replace &

  10. #10
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: HOWTO: 1 click Enable/Disable Composite in Xfce

    I believe this is the best way to do it:

    You can do this from the command line and / or create a launcher to turn it on and off if this is the problem.

    To turn off
    Code:
    xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=false
    To turn on
    Code:
    xfconf-query --channel=xfwm4 --property=/general/use_compositing --set=true

    Just show the flexibility of linux/xfce 5 different ways to do the same thing
    Last edited by Jose Catre-Vandis; May 14th, 2012 at 07:55 PM.
    No longer participating......

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •