4
# Copyright (C) 2008-2009 Oprea Dan
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.
16
# You should have received a copy of the GNU General Public License along
17
# with this program; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
if [ -f backintime.py ]; then
22
PYTHON_BACKINTIME_PATH=""
24
BACKINTIME_PATH="/usr/bin/"
25
PYTHON_BACKINTIME_PATH="/usr/share/backintime/"
32
--gnome) GUI="gnome";;
40
if [ $GUI = "auto" ]; then
41
if [ "$(pidof ksmserver)" ]; then
42
KDE_VERSION=`ksmserver --version | grep KDE:`
43
if [ "$(echo $KDE_VERSION | grep 'KDE: 4.')" ]; then
52
echo "Autodetect GUI mode: $GUI"
55
CMD="python ${PYTHON_BACKINTIME_PATH}backintime.py"
57
#check if the selected gui exists
58
if [ $GUI = "kde4" ]; then
59
#try: kde4, kde3, gnome
60
if [ -f ${BACKINTIME_PATH}backintime-kde4 ]; then
61
CMD="${BACKINTIME_PATH}backintime-kde4"
62
elif [ -f ${BACKINTIME_PATH}backintime-kde3 ]; then
63
CMD="${BACKINTIME_PATH}backintime-kde3"
64
elif [ -f ${BACKINTIME_PATH}backintime-gnome ]; then
65
CMD="${BACKINTIME_PATH}backintime-gnome"
67
elif [ $GUI = "kde3" ]; then
68
#try: kde3, kde4, gnome
69
if [ -f ${BACKINTIME_PATH}backintime-kde3 ]; then
70
CMD="${BACKINTIME_PATH}backintime-kde3"
71
elif [ -f ${BACKINTIME_PATH}backintime-kde4 ]; then
72
CMD="${BACKINTIME_PATH}backintime-kde4"
73
elif [ -f ${BACKINTIME_PATH}backintime-gnome ]; then
74
CMD="${BACKINTIME_PATH}backintime-gnome"
76
elif [ $GUI = "gnome" ]; then
77
#try: gnome, kde4, kde3
78
if [ -f ${BACKINTIME_PATH}backintime-gnome ]; then
79
CMD="${BACKINTIME_PATH}backintime-gnome"
80
elif [ -f ${BACKINTIME_PATH}backintime-kde4 ]; then
81
CMD="${BACKINTIME_PATH}backintime-kde4"
82
elif [ -f ${BACKINTIME_PATH}backintime-kde3 ]; then
83
CMD="${BACKINTIME_PATH}backintime-kde3"