Xfwm Effects 1.1


Xfwm Effects adds depth and color harmony to the Xfce4 Desktop Environment using a hack to the Xfwm4 compositing window manager's code.


beauty_shot.jpg

background: www.deviantart.com/joeyjazz/art/Colour-Ride-786764578


How it works


Xfwm Effects adds depth and color harmony to the appearance of the desktop, without adding distraction. It does so by creating an image of the desktop when necessary, then uses the Imlib2 library to blur the desktop image, then uses Xlib compositing commands to composite the blurred background image onto desktop windows, panels, menus, and popovers. The effect is reminiscent of Apple's 'vibrancy' effect. Using this method sidesteps the computationally expensive need to continually generate gaussian blur, which can slow the responsiveness of the desktop environment.


beauty_shot_2.jpg

background: Sylvia Ritter

www.deviantart.com/sylviaritter/art/Disco-Dingo-786327017


A settings adjustment app is included


Also included is an app (xfwm-effects) that allows the user to turn the effect on and off, to adjust the amount of blur, and to adjust the amount of white composited (for light themes). Note that to see the effects, 'Compositor > Enable Display Compositing' must be selected (i.e., active) in the Window Manager Tweaks app (the compositor is used to draw the effect). Adjusting the sliders on the Compositor tab of the Window Manager Tweaks app toward 'Transparent' will make the effect more pronounced. On the other hand, if the sliders on that tab are all slid to the 'Opaque' position, you will not see the effect at all.


Additional effects


Additional effects are possible via a file path setting that is accessible in the xfce4-settings-editor app (channel: xfwm-effects, property: image-path). This allows the user to specify an image to be composited over windows. For example, the desktop background image might be a picture of a person, while the composited background image might be a picture of a similarly positioned skeleton, giving the windows an X-Ray effect. This effect cannot be combined with the other 'blurred background' effect. Note that the X-Ray effect's file path is ignored if the "Use xlib instead of imlib2..." option is selected in the settings app.


xray_1701.jpg

Example “x-ray” effect, cobbled together from:

Enterprise exterior: Douglas E. Graves deg3d.biz

Enterprise interior schematic: Doug Drexler


xray_day_night.jpg

Another example “x-ray” effect

Day and night images: ArseniXC

www.pixiv.net/member.php?id=202175


Works with:


Xfwm4 version 4.13.2 (64 bit only!). Xfwm4 is the Xfce4 desktop environment's window manager.


The installer script is written for Xubuntu 19.04 ; other distros will need some massaging to get xfwm-effects to work.


Included is:


-xfwm4 (hacked version)

-xfwm-effects (settings app)


Dependencies are:


Imlib2 (the libimlib2 package) for image processing

Usage


1) extract the archived folder (xfwm-effects.tar.gz) containing the needed files, which include:


-README.txt

-xfwm4

-xfwm-effects

-xfwm-effects.desktop

-xfwm-effects.glade

-xfwm-effects.svg

-xfwm-effects.xml

-xfwm-effects-install.sh


2) open a terminal window, "cd" to the file path of the install folder you just unarchived:


cd /home/user/Downloads/xfwm-effects


the above is just an example; your "user" is different!


and type:


sudo bash xfwm-effects-install.sh


then enter your password if prompted


-this script will install the files; user password will be required if not root

-it will also install the imlib2 library, needed for image processing, using apt-get


3) now to start the effect, in a terminal window, type:


xfwm4 --replace & disown


Note: the 'replace' part exits the stock window manager (at /usr/bin) and starts up the hacked version (at /usr/local/bin/); the 'disown' part disconnects the new process from the terminal.


4) start Window Manager Tweaks, select the Compositor tab, select Enable Display Compositing, and move the sliders on that tab somewhat closer to 'Transparent' (since you will not see the effect when they are set at 'Opaque', which is the default position)


tweaks_settings.jpg

Example “Window Manager Tweaks” settings

background: mage

www.pixiv.net/member_illust.php?mode=medium&illust_id=46088374


5) Xfwm Effects _works best with dark themes_ (selected in Appearance) and dark window frames (selected in Window Manager), so try these first. A good one is appearance: Adwaita-dark; window manager theme: Default.


Note: keep the 'White amount' slider of the Xfwm Effects panel at zero for all dark themes; keep the 'White amount' slider above zero for all light themes. This is because the 'White amount' setting not only adjusts the amount of white added, but also changes type type of compositing that is done (one type favors light themes and once favors dark themes).


white_amount.jpg

Example light theme with “White amount” added

background: www.deviantart.com/joeyjazz/art/Colour-Ride-786764578


Also note: some apps have their own transparency settings, such as Whisker menu and the Xfce4 panel. Changing the 'opacity' level for these apps in their properties settings will adjust the effect.


whisker_panel.jpg

Traslucent whisker menu and panel

background: smile

www.pixiv.net/member_illust.php?mode=medium&illust_id=58203821


How to build (for xfwm4 4.13.2 on Xubuntu 19.04)


I apologize in advance for the following crappy build instructions.


First, download the compressed source code for xfwm4:

xfwm4-4.13.2.tar.gz

from https://git.xfce.org/xfce/xfwm4/ and expand it.


Use 'Synaptic' to install:

make, xfce4-dev-tools, libglib2.0-dev, xorg-dev,

libpango1.0-dev, libatk1.0-dev, libepoxy-dev,

libatk-bridge2.0-dev, libgtk-3-dev, libxfce4util-dev,

libxfce4ui-2-dev, libwnck-3-dev, gawk, libimlib2-dev


(Or, at the command line: 'sudo apt-get install make xfce4-dev-tools' ...etc.)


At this point, copy the provided files compositor.c, screen.c and screen.h to the /src subdirectory


Copy the 'effects' source code folder so it is under settings-dialogs/ (just a suggestion; not necessary)


At the terminal, 'cd' into the expanded xfwm4 source-code folder, and 'sudo ./autogen.sh'


Open the Makefile under src/ with an editor; add the Imlib2 library to the end of this line:


COMPOSITOR_LIBS = -lXcomposite -lXdamage -lXfixes


so it looks like:


COMPOSITOR_LIBS = -lXcomposite -lXdamage -lXfixes -lImlib2


and Save As to filename Makefile2. Makefile is write-protected, so rm the old Makefile, and mv the new Makefile2 to Makefile to replace it.


Then, to build the hacked xfwm4, 'cd' into the main source code folder, probably named 'xfwm4-4.13.2' and


'sudo make && sudo make install'


Next, to build the settings panel (optional) 'cd' into the 'settings-dialogs/effects' folder of the source code and 'sudo make && sudo make install' to compile the xfwm-effects control panel.


To start and use xfwm-effects, just go to ##Usage step 3 in this document.


Known issues


Shadows under windows are almost invisible when the slider for frame opaqueness in Window Manager Tweaks is set closer to the 'Transparent' setting, so you probably won't see shadows under the windows when the effect is active.


X-Ray effect file path is ignored if "Use xlib instead of imlib2..." setting is selected in the settings app. Also, "Use xlib instead of imlib2..." will not work if imlib2 is not installed because imlib2 is not loaded conditionally.


Troubleshooting


If you run into problems, first try logging out and logging back in, and if that does not work then try reinstalling xfwm effects.


Note Well: You can restart the original (unmodified) xfwm4 window manager at the terminal with:


'sudo /usr/bin/xfwm4 --replace & disown'


Changelog


1.1 added (experimental) option to use xlib instead of imlib2 for blur in the settings app (however, it's slower and requires more cpu)


1.0 initial release


Contact


jnrh2001(at)yahoo(dot)com


License


Xfwm Effects License Info (= MIT License)


Copyright 2019 James Hoover


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Xfwm4 License Info


Copied and pasted from the 'compositor.c' source code file...


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

xcompmgr - (c) 2003 Keith Packard

metacity - (c) 2003, 2004 Red Hat, Inc.

xfwm4 (c) 2005-2015 Olivier Fourdan


Imlib2 License


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies of the Software and its Copyright notices. In addition publicly documented acknowledgment must be given that this software has been used if no source code of this software is made available publicly. Making the source available publicly means including the source for this software with the distribution, or a method to get this software via some reasonable mechanism (electronic transfer via a network or media) as well as making an offer to supply the source on request. This Copyright notice serves as an offer to supply the source on on request as well. Instead of this, supplying acknowledgments of use of this software in either Copyright notices, Manuals, Publicity and Marketing documents or any documentation provided with any product containing this software. This License does not apply to any software that links to the libraries provided by this software (statically or dynamically), but only to the software provided.


Please see the COPYING-PLAIN for a plain-english explanation of this notice and its intent.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.