aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xfce4-firstrun
blob: 2e5809b0bde37ac57d0fa68e1d27f801676b1b71 (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
#!/bin/sh
# Simple script which configure Xfce environment for a fresh user
# Author: tpg@mandriva.org
# Licensed under GPL terms

MGA_FLAVOUR=$(echo $META_CLASS)
USER_DESKTOP=$(xdg-user-dir DESKTOP)
DESKTOP_FILE=$HOME/.config/autostart/xfce4-firstrun.desktop

if [ $(whoami) = "root" ]; then
    echo "xfce4-firstrun: not supported for superuser."
    exit || 0
else
    if [ ! -e $DESKTOP_FILE ]; then
	echo "xfce4-firstrun: localised desktop folder exists."
	if [ ! -d $HOME/.config/autostart ]; then
	    mkdir -p $HOME/.config/autostart
	fi

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

	if [ $MGA_FLAVOUR = "download" -o $MGA_FLAVOUR = "desktop" ]; then
	    if [ ! -e $USER_DESKTOP/mageia-draklive-install.desktop ]; then
		cp -f /usr/share/applications/mageia-draklive-install.desktop $USER_DESKTOP 2> /dev/null
	    fi
		if [ "$(pidof xfdesktop)" ]; then 
		    xfdesktop --reload 1> /dev/null; echo "xfce4-firstrun: xfdesktop reloaded.";
		fi
	    exit || 0
	else

	    if [ ! -e $USER_DESKTOP/mageia-draklive-install.desktop ]; then
		cp -f /usr/share/applications/mageia-draklive-install.desktop $USER_DESKTOP 2> /dev/null
	    fi
		if [ "$(pidof xfdesktop)" ]; then 
		    xfdesktop --reload 1> /dev/null; echo "xfce4-firstrun: xfdesktop reloaded.";
		fi
	    exit || 0
	fi
    else echo "xfce4-firstrun: make sure you have installed xdg-user-dirs-gtk and xdg-user-dir packages."
    fi
fi

#EOF