2
# Starts Compiz Decorator depending on the DE
4
# Copyright (c) 2007 CyberOrg <cyberorg@cyberorg.info>
5
# Based on compiz-manager script by Kristian Lyngstøl <kristian@bohemians.org>
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
# Contributions by: crdlb
22
# Modifications by: Daniel van Vugt <daniel.van.vugt@canonical.com>
25
if [ -z "$COMPIZ_BIN_PATH" ]; then
26
COMPIZ_BIN_PATH="/usr/bin/"
29
METACITY="/usr/bin/metacity"
32
# Default to gtk/kde4-window-decorator
37
#Do not leave users without decoration if decorator fails
38
if [ "$DESKTOP_SESSION" = "kde" ]; then
41
FALLBACKWM="${METACITY}"
43
FALLBACKWM_OPTIONS=" --replace"
46
# Set to yes to enable verbose
51
# Echos the arguments if verbose
55
if [ "x$VERBOSE" = "xyes" ]; then
60
# Read configuration from XDG paths
61
if [ -z "$XDG_CONFIG_DIRS" ]; then
62
test -f /etc/xdg/compiz/compiz-manager && . /etc/xdg/compiz/compiz-manager
64
test -f $XDG_CONFIG_DIRS/compiz/compiz-manager && . $XDG_CONFIG_DIRS/compiz/compiz-manager
67
if [ -z "$XDG_CONFIG_HOME" ]; then
68
test -f $HOME/.config/compiz/compiz-manager && . $HOME/.config/compiz/compiz-manager
70
test -f $XDG_CONFIG_HOME/compiz/compiz-manager && . $XDG_CONFIG_HOME/compiz/compiz-manager
74
if [ -x ${COMPIZ_BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then
76
elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ] && [ -n "$GNOME_DESKTOP_SESSION_ID" ]; then
77
DECORATOR=gtk-window-decorator
78
elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ] && [ x$KDE_SESSION_VERSION = x"4" ]; then
79
DECORATOR=kde4-window-decorator
82
# fall back to any decorator that is installed
83
if [ -z "$DECORATOR" ]; then
84
verbose "Couldn't find a perfect decorator match; trying all decorators\n"
85
if [ -x ${COMPIZ_BIN_PATH}emerald ]; then
87
elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ]; then
88
DECORATOR=gtk-window-decorator
89
elif [ -x ${COMPIZ_BIN_PATH}kde4-window-decorator ]; then
90
DECORATOR=kde4-window-decorator
94
if [ -n "$DECORATOR" ]; then
95
verbose "Starting ${DECORATOR}\n"
96
exec ${COMPIZ_BIN_PATH}$DECORATOR "$@"
98
verbose "Found no decorator to start\n"
99
exec $FALLBACKWM $FALLBACKWM_OPTIONS