Xcompmgr

From ArchWiki
Revision as of 05:38, 29 October 2012 by The Compiler (Talk | contribs) (Whoops, consistency)

Jump to: navigation, search
Summary help replacing me
Describes the installation and usage of xcompmgr.
Related articles
Composite – Xorg extension required by composite managers
Compiz – original composite/window manager from Novell
Cairo Compmgr – versatile and extensible composite manager which uses cairo for rendering
Compton – A bug-fixed fork of dcompmgr, which is a fork of xcompmgr
AIGLX
Xorg
Window Manager

Xcompmgr is a simple composite manager, capable of rendering drop shadows and, with the use of the transset utility, primitive window transparency. Designed solely as a proof-of-concept, xcompmgr is a lightweight alternative to Compiz Fusion and similar composite managers.

Because it does not replace any existing window manager, it is an ideal solution for users of lightweight window managers, seeking a more elegant desktop.

Prerequisites

Xcompmgr requires the following:

  • Xorg must be installed, configured and running
  • Composite must be enabled via graphics drivers or AIGLX

Installation

Install packages xcompmgr and transset-df, available in the official repositories.

Configuration

To load xcompmgr, simply run:

$ xcompmgr -c

To have it load at session start, add the following to xprofile:

xcompmgr -c &

Instead of -c you can experiment with the other switches to modify the drop-shadows or even enable fading. Below is a common example:

xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &

For a full list of options, run:

$ xcompmgr --help

Window Transparency

Although its practical use is limited, due to its slow performance, the transset-df utility can be used to set the transparency of individual windows.

To set the transparency of a program window, make sure the desired program is already running, then execute:

transset-df n

.. where n is a number from 0 to 1, zero being transparent and 1 being opaque.

Once executed, the mouse cursor will transform to a crosshair. Simply click the desired window and the transparency will change to the value specified. For example, transset-df .25 will set the target window to 75% opacity.

Troubleshooting

Mozilla Firefox crashes when entering a Flash site

You can fix it by creating an executable file named /etc/profile.d/flash.sh containing this line:

export XLIB_SKIP_ARGB_VISUALS=1

Warning! this will disable compositing effects aswell as cause kwin to not function and cairo-compmgr to crash.

Background turns light gray briefly after logging in (e.g. in Openbox)

This is fixed by installing hsetroot and setting the background color by executing hsetroot -solid "#000000" (just type the code of the colour you want instead of 000000) before xcompmgr.

BadPicture request in awesome wm

if you get the following error in awesome:

 error 163: BadPicture request 149 minor 8 serial 34943
 error 163: BadPicture request 149 minor 8 serial 34988
 error 163: BadPicture request 149 minor 8 serial 35033

just install the package feh and restart awesome.

Chromium & Xcompmgr & Awesome & Conky

I got some problems at startup after changing the displayresolution and autostarting Chromium in AwesomeWM (laptop with external monitor). In Combination with Conky there is always some part of the screen "stuck", the problem came from my resolution change at start via .xinitrc and Awesome setting the background afterwards via feh. I solved this by putting

hsetroot -solid "#000066"

in my .xinitrc just before xcompmgr.

Tips

Starting/Stopping xcompmgr on Demand

This script (e.g. in ~/bin) allows easy (re)starting and stopping of the compositing manager.

#!/bin/bash
#
# Start a composition manager.
# (xcompmgr in this case)

comphelp() {
  echo "Composition Manager:"
  echo "   (re)start: COMP"
  echo "   stop:      COMP -s"
  echo "   query:     COMP -q"
  echo "              returns 0 if composition manager is running, else 1"
  exit
}

checkcomp() {
  pgrep xcompmgr &>/dev/null
}

stopcomp() {
  checkcomp && killall xcompmgr
}

startcomp() {
  stopcomp
# Example settings only. Replace with your own.
  xcompmgr -CcfF -I-.015 -O-.03 -D6 -t-1 -l-3 -r4.2 -o.5 &
  exit
}

case "$1" in
    "") startcomp ;;
  "-q") checkcomp ;;
  "-s") stopcomp; exit ;;
     *) comphelp ;;
esac

I bound COMP and COMP -s to two hot keys in IceWM because there are a few glitches using xcompmgr in this WM. This allows for fast restart or temporary composition removal if needed without interrupting other work.

Toggle on/off xcompmgr with one hot-key only

Using the status part of the script above.

Assign the following script to any hot-key:

#!/bin/bash

if pgrep xcompmgr &>/dev/null; then
       echo "Turning xcompmgr ON"
       xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &
else
       echo "Turning xcompmgr OFF"
       pkill xcompmgr &
fi

exit 0

Forks and updated versions

As xcompmgr in no longer maintained, you may consider using the xcompmgr-danaAUR or the compton-gitAUR packages from the AUR. These versions include a few bugfixes, and allow you to set menu transparency with the -m parameter :

#!/bin/bash

compton -m.80

Replace 80 with the opacity you want, in percents. This works for any menu, including the Openbox main menu.