#!/bin/sh
# Starts Compiz Decorator depending on the DE
#
# Copyright (c) 2007 CyberOrg <cyberorg@cyberorg.info>
# Based on compiz-manager script by Kristian Lyngstøl <kristian@bohemians.org>
# 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 of the License, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#
BIN_PATH=/usr/bin/
# Read configuration from XDG paths
if [ -z "$XDG_CONFIG_DIRS" ]; then
test -f /etc/xdg/compiz/compiz-manager && . /etc/xdg/compiz/compiz-manager
else
test -f $XDG_CONFIG_DIRS/compiz/compiz-manager && . $XDG_CONFIG_DIRS/compiz/compiz-manager
fi
if [ -z "$XDG_CONFIG_HOME" ]; then
test -f $HOME/.config/compiz/compiz-manager && . $HOME/.config/compiz/compiz-manager
else
test -f $XDG_CONFIG_HOME/compiz/compiz-manager && . $XDG_CONFIG_HOME/compiz/compiz-manager
fi
if [ -x ${BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then
${BIN_PATH}emerald --replace &
elif [ x$DESKTOP_SESSION = x"kde" ] && [ -x ${BIN_PATH}kde-window-decorator ]; then
${BIN_PATH}kde-window-decorator --replace &
elif [ x$KDE_SESSION_VERSION = x"4" ] && [ -x ${BIN_PATH}kde4-window-decorator ]; then
${BIN_PATH}kde4-window-decorator --replace &
else
${BIN_PATH}gtk-window-decorator --replace &
fi