aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xfce4-update-config
blob: e158e85b89e300b7c70455cfdc2ab54e1c07ddf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

MDV_FLAVOUR=`echo $META_CLASS`
USER_DESKTOP=`xdg-user-dir DESKTOP`
DESKTOP_FILE=$HOME/.config/autostart/xfce4-update-config.desktop

if [ `whoami` = "root" ]; then
    echo "Not supported for root user"
    exit || 0
else
    if [ ! -e $DESKTOP_FILE ]; then
	echo "Localised desktop folder exists."
	if [ ! -d $HOME/.config/autostart ]; then
	mkdir -p $HOME/.config/autostart
	fi

cat > $HOME/.config/autostart/xfce4-update-config.desktop << EOF
[Desktop Entry]
Hidden=true
EOF
#

	if [ $MDV_FLAVOUR = "download" -o $MDV_FLAVOUR = "desktop" ]; then
	    if [ ! -e $USER_DESKTOP/register.desktop ]; then
		cp -f /usr/share/mdk/desktop/free/register.desktop $USER_DESKTOP
	    fi

	    if [ ! -e $USER_DESKTOP/upgrade.desktop ]; then
		cp -f /usr/share/mdk/desktop/one/upgrade.desktop $USER_DESKTOP
	    fi
	    
	    if [ ! -e $USER_DESKTOP/mandriva-draklive-install.desktop ]; then
		cp -f /usr/share/applications/mandriva-draklive-install.desktop $USER_DESKTOP
	    fi

	    xfdesktop --reload
	    exit || 0

	else
	    if [ ! -e $USER_DESKTOP/register.desktop ]; then
		cp -f /usr/share/mdk/desktop/powerpack/register.desktop $USER_DESKTOP
	    fi
	    
	    if [ ! -e $USER_DESKTOP/mandriva-draklive-install.desktop ]; then
		cp -f /usr/share/applications/mandriva-draklive-install.desktop $USER_DESKTOP
	    fi
	    
	    xfdesktop --reload
	    exit || 0
	fi
    fi
fi

#EOF