I made a script: it fades unfocused windows and gives 100% opacity to the focused one. Pretty neat but somewhat resource hungry. Inspired by eutotrans.rb by Daniel Forchheimer.
It depends on bash and standard X tools only, and should work with other WMs too (tested with metacity).
Code:
#!/bin/sh
# This is a script that uses transset-df or any other transset-
# patch that can take an window id as argument to allow
# opacity to follow the focused window.
# The focused window get opacity 1.0 while all others
# have opacity set by the var 'FADING' in this script
# It is licensed under the GNU GPL license
# http://www.gnu.org/licenses/gpl.html
# This program is written by: Luca De Rugeriis
# inspired by the work of Daniel Forchheimer (eutotrans.rb)
# Last update: 2005-12-29
FADING=0.85
TRANSSET="/usr/bin/transset-df"
#fade all windows
WINDOWS_LIST=`xwininfo -root -children | grep -v panel | sed '1,6d' | grep -v 0x1000021 | cut -d " " -f 6`
for i in $WINDOWS_LIST;do
$TRANSSET --id $i $FADING
done
LAST_FOCUSED=0
while (true); do
FOCUSED=`xdpyinfo | grep focus | cut -c 16-24`
if [ $LAST_FOCUSED != $FOCUSED ]; then
$TRANSSET --id $FOCUSED 1
$TRANSSET --id $LAST_FOCUSED -t $FADING
LAST_FOCUSED=$FOCUSED
fi
sleep .1
done
To launch and kill it I use modified version of frodon's script:
Code:
#!/bin/bash
if [ "$(pidof xcompmgr)" ]
then
killall xcompmgr
for i in `ps ax|grep eutotrans|grep -v grep |cut -d " " -f 1`;do
kill $i
done
sleep .5
killall metacity
else
xcompmgr -fF -I.02 -O.02 -D6 -cC -t-4 -l-8 -r5&
~/bin/eutotrans-clean.sh&
sleep .5
killall metacity
fi
Have fun!