#!/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.75 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