-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathinstall_mate_desktop
executable file
·135 lines (109 loc) · 4.66 KB
/
install_mate_desktop
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/bash
# ******************************
# Install minimal mate desktop *
# ******************************
if [ "$(id -u)" != "0" ]; then
echo "Script must be run as root !"
exit 0
fi
echo ""
date
echo -e "\033[36m======================="
echo -e "Installing Mate Desktop"
echo -e "=======================\033[37m"
setterm -default
echo ""
# Check if we have enough disk space.
S=`df / | tail -n 1 | awk '{printf $4}' | sed s/[G,M,K]//g`
if [ "$S" -le "500000" ]; then
echo "We need at least 500MB free to perform minimal desktop instalation"
echo "Have you resized your partition (fs_resize)?"
exit 0
fi
# SET USER NAME !!
_user="orangepi"
logfile="mate-install.log"
#logfile=/dev/stdout
#_auto=""
_auto="-y -q"
_DST=`lsb_release -si`
_REL=`lsb_release -sc`
if [ ! "${_REL}" = "jessie" ] && [ ! "${_REL}" = "vivid" ] && [ ! "${_REL}" = "wily" ]; then
echo "Not supported on ${_DST}-${_REL}"
exit 0
fi
if [ ! "${_DST}" = "Ubuntu" ]; then
_mever=`cat /etc/apt/sources.list | grep -o meveric`
if [ "${_mever}" = "" ]; then
wget -O- http://oph.mdrjr.net/meveric/meveric.asc | apt-key add -
echo "deb http://oph.mdrjr.net/meveric/ jessie main" >> /etc/apt/sources.list
fi
fi
echo "Package update..."
apt-get $_auto update >> $logfile
echo "Package upgrade..."
apt-get $_auto upgrade >> $logfile
echo ""
echo "$_DST - $_REL, Installing MATE DESKTOP..."
echo "$_DST - $_REL, Installing MATE DESKTOP..." > $logfile
# === Install desktop =============================================================================================================================================================
echo " installing Mate desktop, please wait..."
apt-get $_auto install xinit xserver-xorg >> $logfile
apt-get $_auto install lightdm lightdm-gtk-greeter policykit-1 --no-install-recommends >> $logfile
apt-get $_auto install mate-desktop-environment pluma engrampa mate-themes mate-system-monitor mate-applets mate-utils atril eom mozo mate-indicator-applet mate-media --no-install-recommends >> $logfile
if [ "${_DST}" = "Ubuntu" ] ; then
apt-get clean
apt-get $_auto install language-selector-gnome ubuntu-mate-lightdm-theme lightdm-gtk-greeter-settings mate-tweak indicator-sound --no-install-recommends >> $logfile
fi
apt-get $_auto install pulseaudio pulseaudio-module-x11 pulseaudio-utils alsa-base alsa-oss alsa-utils alsa-tools libasound2-data pavucontrol --no-install-recommends >> $logfile
apt-get $_auto install smplayer >> $logfile
apt-get clean
echo " installing more packages, please wait..."
apt-get $_auto install synaptic software-properties-gtk policykit-1-gnome gksu galculator --no-install-recommends >> $logfile
apt-get clean
# === Install network packages & internet browser =================================================================================================================================
# you don't have to install internet browser, you can save ~100MB
echo " installing network packages, please wait..."
if [ "${_DST}" = "Ubuntu" ] ; then
apt-get $_auto install chromium-browser gvfs-fuse gvfs-backends network-manager-gnome --no-install-recommends >> $logfile
else
#apt-get $_auto install iceweasel gvfs-fuse gvfs-backends network-manager-gnome --no-install-recommends >> $logfile
apt-get $_auto install gvfs-fuse gvfs-backends network-manager-gnome --no-install-recommends >> $logfile
apt-get $_auto install chromium-browser-odroid >> $logfile
fi
#apt-get $_auto install x2goserver >> $logfile
apt-get clean
# === Configuration ===============================================================================================================================================================
echo ""
echo "Configuring desktop..."
if [ -f /etc/X11/Xwrapper.config ]; then
cat /etc/X11/Xwrapper.config | sed s/"allowed_users=console"/"allowed_users=anybody"/g > /tmp/_xwrap
mv /tmp/_xwrap /etc/X11/Xwrapper.config
fi
#*********************
# ** CONFIGURE SOUND
#*********************
cat > /etc/asound.conf << _EOF_
pcm.!default {
type hw
card 1 #If you want to set HDMI as output ,turn 0 to 1.
device 0
}
ctl.!default {
type hw
card 1 #If you want to set HDMI as output ,turn 0 to 1.
}
_EOF_
if [ -f /etc/pulse/default.pa ]; then
cat /etc/pulse/default.pa | sed s/"load-module module-udev-detect$"/"load-module module-udev-detect tsched=0"/g > /tmp/default.pa
mv /tmp/default.pa /etc/pulse/default.pa
fi
usermod -a -G adm,dialout,cdrom,dip,video,plugdev,netdev,fuse $_user
chown -R $_user:$_user /home/$_user
echo ""
echo "**********************************************"
echo "* MATE DESKTOP INSTALLED, please REBOOT now! *"
echo "**********************************************"
setterm -default
date
echo ""