#!/bin/sh

# Script to make selected window transparent by Faheem Pervez (qwerty12)
# Thanks to qole for the choice of icon

RUNNING=`ps | grep xcompmgr | grep -v -e grep -e \.sh`

if [ $? != 0 ]; then
	text='Starting xcompmgr, wait 5 seconds'
	run-standalone.sh dbus-send --print-reply --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"$text" 2> /dev/null 1> /dev/null
	xcompmgr -O 0.5 -I 0.2 -D 66 -C -r 6 -t -6 -l -6 -o 0.5 &
	sleep 5
fi

run-standalone.sh dbus-send --print-reply --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Select window to toggle transparency on" 2> /dev/null 1> /dev/null
transset-df -t
