How to install Mate Compiz and Docky on Centos 7

Issues related to applications and software problems
Post Reply
gyoramg
Posts: 4
Joined: 2014/07/19 10:47:38

How to install Mate Compiz and Docky on Centos 7

Post by gyoramg » 2014/08/04 15:54:14

Mate 1.8 from Epel, Compiz from nux-dextop (with some elements still from F19) and Docky from Fedora 19 repos, seem to behave nicely on CentOS 7. I therefore wrote a script that will automate the installation of those packages. The script can be applied to minimal CentOS7 system and it will install X-Windows and then the Mate Desktop, or to an existing desktop system and it will then add the Mate Desktop and optionally remove the "Gnome 3 shell" and "Gnome Classic" desktops. Installation of compiz and docky is optional. Since in an existing desktop system the script may interfere with the existing X session and with the Display Manager, it should run at run level 3 (multiuser level).
Here is what the script does:

1. Get information from the user what he/she wants to do.
2. Update the system and then install yum-plugin-priorities.
3. Enable epel, nux-dextop, elrepo and rpmforge external repositories and set priorities in such a way that CentOS packages will not be overwritten.
4. If needed, install the "X Windows System" packages group Install the "Mate Desktop" group from Epel
6. Install caja .desktop file in /etc/xdg/autostart/ to ensure that icons on the desktop are visible.
7. Set the default runlevel to "graphical user" (level 5)
8. Optionally, remove gnome-session, gnome-classic-sesion and related packages.
9. If 8 was performed or if so choosen by the user, set lightdm as the default window manager.
10. Optionally, install Fedora19 repos, install compiz and docky
11. Disable the Fedora19 repositories.

I sucesfully checked the script both on a VirtualBox guest machine an on a real hardware. Saying that, I am of course nor responsible for any damage this script may cause to you.

Note

So, here it is:
---------------------------------------------------------------------------------------------------------------------------------------------

Code: Select all

#!/bin/bash
#
### This script will install Mate desktop from EPEL repository
#   on a CentOS 7 system. 
#   Optionaly, the "Gnome3 shell", "Gnome Classic desktop" 
#   and gdm will be removed. In this case, the lightdm display
#   manager will be set as the default window manager.
# 
#   Compiz and docky from Fedora19, seem to work nicely with CentOS7,
#   therefore, as another option, the script will install them
#   from Fedora19 standard repositories.
#
#   Copyright 2014 by Yoram Gnat <yoram.gnat@gmail.com>
#   Published under GPL v2 License
#
#   Note: Since this script may change the display session
#   ====  and display manager it should run at runlevel 3 (multiuser)
#         and not runlevel 5 (graphical user)
#

#================================================================
### Be sure we are at runlevel 3
runlevel | grep 3 > /dev/null
if [ "$?" != "0" ]; then
	echo "This script should run at level 3 (multiuser level)."
	echo "As root, type the command 'init 3' in a shell"
	echo "then, login as root and run this script again"
	exit 1
fi

#================================================================
InstallX="false"
RemoveG3="false"
LightdmIsDefault="false"
InstallCompiz="false"

echo
echo "Mate Desktop will be installed on your system."
echo
### if X server is not installed we have the minimal installation and the 
#   questions are irrelevant. 
rpm -q xorg-x11-server-Xorg > /dev/null
if [ "$?" != "0" ]; then
	InstallX="true"
	LightdmIsDefault="true"
### else let's find what we should do
else
	echo "Do you want to remove GNOME3 and Gnome Classic desktops "
	echo -n "after installing Mate ? (y/n)"
	read A
	if [ "$A" = "y" ]; then
		RemoveG3="true"
		LightdmIsDefault="true"
	else
		echo -n "Do you want to make lightdm the default window manager ? (y/n)"
		read A
		if [ "$A" = "y" ]; then
			LightdmIsDefault="true"
		fi
	fi
fi

### What about compiz and docky ?
echo -n "Do you want to install Compiz (y/n) and docky from Fedora19 ? (y/n)"
read A
if [ "$A" = "y" ]; then
	InstallCompiz="true"
fi

HERE=`pwd`

#============================ Here we start =============================
#
### Update the system
echo
echo "Updating System"
echo
yum -y update

#=============================================================================
#  We need yum priorities to ensure base CentOS packages are not overwritten. 

yum -y install yum-plugin-priorities

#==============================================================================
#
### Enable extra repos (epel, nux-dextop, elrepo and rpmforge)for CentOS 7 

# EPEL
if [ ! -f /usr/yum.repos.d/epel.repo ]; then 
	rpm -Uvh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
fi

# nux-dextop
if [ ! -f /usr/yum.repos.d/nux-dextop.repo ]; then 
	rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-3.el7.nux.noarch.rpm
fi

# ELREPO
if [ ! -f /usr/yum.repos.d/elrepo.repo ]; then 
	rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
	rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
fi

# RPMFORGE
if [ ! -f /usr/yum.repos.d/rpmforge.repo ]; then 
	rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
fi

### Set repo priorities
echo
echo "Set yum priorities to ensure that packages from official CentOS"
echo "repositories are not overwritten."
echo

echo "CentOS-Base repos, priority=1"
cp /etc/yum.repos.d/CentOS-Base.repo /tmp/CentOS-Base.repo
sed \
	-e ' s/\[base\]/\[base\]\npriority=1/g' \
	-e ' s/\[updates\]/\[updates\]\npriority=1/g' \
	-e ' s/\[extras\]/\[extras\]\npriority=1/g' \
	-e ' s/\[centosplus\]/\[centosplus\]\npriority=1/g' \
	-e ' s/\[contrib\]/\[contrib\]\npriority=2/g' \
	-e ' s/enabled=0/enabled=1/g' 	/tmp/CentOS-Base.repo > /etc/yum.repos.d/CentOS-Base.repo

echo "epel repo, priority=10"
cp /etc/yum.repos.d/epel.repo /tmp/epel.repo
sed -e 's/\[epel\]/\[epel\]\npriority=10/g' /tmp/epel.repo > /etc/yum.repos.d/epel.repo

echo "nux-dextop repo, priority=11"
cp /etc/yum.repos.d/nux-dextop.repo /tmp/nux-dextop.repo
sed -e 's/\[nux-dextop\]/\[nux-dextop\]\npriority=11/g' /tmp/nux-dextop.repo > /etc/yum.repos.d/nux-dextop.repo

echo "elrepo repo, priority=12"
echo
cp /etc/yum.repos.d/elrepo.repo /tmp/elrepo.repo
sed -e 's/\[elrepo\]/\[elrepo\]\npriority=12/g' /tmp/elrepo.repo > /etc/yum.repos.d/elrepo.repo

echo "rpmforge repo, priority=13"
cp /etc/yum.repos.d/rpmforge.repo /tmp/rpmforge.repo
sed -e 's/\[rpmforge\]/\[rpmforge\]\npriority=13/g' /tmp/rpmforge.repo > /etc/yum.repos.d/rpmforge.repo


echo
#==========================================================================
# If we start with minimal system, we should install X
# Since we do not want proprietary drivers at this stage, let's disable elrepo
# Such drivers, eg. nvidia, can be installed later.

if [ $InstallX = "true" ]; then
	yum -y --disablerepo=elrepo groupinstall "X Window System"
fi
#==========================================================================
#
### Mate Desktop
#

yum -y groupinstall "MATE Desktop"

### Be sure we start at what was once called run level 5 (graphical user).
systemctl set-default graphical.target

### Be sure caja is autostarting so that desktop icons will be visible
#
cat > /etc/xdg/autostart/caja-manage-desktop.desktop << EOF
[Desktop Entry]
Name=caja-manage-desktop.desktop
GenericName=File Manager
Exec=caja --no-default-window
Icon=system-file-manager
Terminal=false
Type=Application
StartupNotify=true
NoDisplay=true
OnlyShowIn=MATE;
X-MATE-Bugzilla-Bugzilla=MATE
X-MATE-Bugzilla-Product=caja
X-MATE-Bugzilla-Component=general
X-MATE-Bugzilla-Version=1.8.0
X-MATE-Autostart-Phase=Desktop
X-MATE-Autostart-Notify=true
X-MATE-AutoRestart=true
X-MATE-Provides=filemanager
X-Desktop-File-Install-Version=0.21
Name[en_US]=caja-manage-desktop.desktop
EOF

#==========================================================================
#
if [ "$RemoveG3" = "true" ]; then
	### Remove gdm, Gnome3 shell and Gnome Classic 
	yum -y remove \
		gdm \
		gnome-backgrounds gnome-boxes gnome-calculator \
		gnome-classic-session gnome-color-manager \
		gnome-contacts gnome-dictionary gnome-documents \
		gnome-font-viewer gnome-getting-started-docs \
		gnome-initial-setup gnome-packagekit gnome-shell \
		gnome-shell-extension* gnome-system-log gnome-terminal \
		gnome-tweak-tool gnome-video-effects gnome-weather \
		gnome-session nautilus*

		# just to be sure, remove definitions of old sessions if still there
		rm -f /usr/share/xsessions/*gnome*.desktop
		rm -f /usr/share/xsessions/*custom*.desktop
fi

#===============================================================================
#
if [ "$LightdmIsDefault" = "true" ]; then
		### make lightdm the default display manager
		ln -sf /usr/lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service
fi

#===================================================================================
#  Be sure some stuff we need is installed.
#  We need gcc and kernel-devel if we are a VirtualBox guest and want the 
#  VirtualBox additions installed.
#  We need wget later in this script and if docky is installed, xdotool may be helpful.
#  Since the xdotool from EPEL won't install we will install the one from nux-dextop.
#  Luckily epel is not needed for the other stuff.

	yum -y --disablerepo=epel install  gcc kernel-devel kernel-headers wget xdotool yumex

#====================================================================================
#
### Compiz
#
#   Let's have compiz. The Fedora19 version works prety well on CentOS7. 
#   The only installation problem is that mate-compiz depends on libmatewnck
#   that is obsoleted by  mate-desktop in 1.8. Since the two packages
#   do not share the same files, there is no real problem in forcing the
#   installation of both. So, we download the libmatewnck package and install it with
#   "rpm --nodeps -ivh ...", then activate the Fedora19 yum repos and install the rest
#   with yum. Since we already have the F19 repos, let's install docky as well.
#   The Fedora19 repos are at very low priority (50) so F19 packages will not overide
#   the CentOS7 stuff.

if [ "$InstallCompiz" = "true" ]; then
	# get the Fedora19 repositories
	cat > /etc/yum.repos.d/fedora19.repo << EOF
[fedora19]
priority=50
name=Fedora 19 - x86_64
failovermethod=priority
baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/19/Everything/x86_64/os/
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-x86_64

[fedora19-updates]
priority=50
name=Fedora 19 - - Updates
failovermethod=priority
baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/19/x86_64/
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-x86_64
EOF

	cd /tmp
	# get the GPG key
	wget https://fedoraproject.org/static/FB4B18E6.txt
	mv -f FB4B18E6.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-19-x86_64

        #!!! Not needed anymore thanks to nux-dextop repo. Most of compiz, adopted to Mate 1.8 
        # on CentOS 7 is already there
	###  install libmatewnck
	#wget http://download.fedoraproject.org/pub/fedora/linux/updates/19/x86_64/libmatewnck-1.6.1-1.fc19.x86_64.rpm
	#rpm --nodeps -ivh libmatewnck-1.6.1-1.fc19.x86_64.rpm
	#rm -f libmatewnck-1.6.1-1.fc19.x86_64.rpm
	cd $HERE

	#### finally install compiz and docky
	yum -y install --enablerepo=fedora19 --enablerepo=fedora19-updates compiz compiz-mate compiz-manager  \
	                                                  fusion-icon compiz-plugins-main compiz-plugins-extra docky
fi

#==========================================================================
#
echo
echo "Reboot the system now."
echo
if [ "$InstallCompiz" = "true" ]; then
	echo "To start using compiz, run 'compiz-mate-emerald' or 'compiz-mate-gtk'."
	echo "To make it permanent run for example:"
	echo "gsettings set org.mate.session.required-components windowmanager compiz-mate-gtk"
	echo
	echo "You can configure compiz plugins using 'ccsm' - the compiz configuration manager."
	echo
fi 
echo 
echo "Have fun."
echo
exit 0

joncr
Posts: 28
Joined: 2012/07/10 18:29:25
Contact:

Re: How to install Mate Compiz and Docky on Centos 7

Post by joncr » 2014/08/12 22:21:48

Thanks for this! Works just fine.

User avatar
Nux
Posts: 37
Joined: 2013/11/08 12:37:05
Location: Delta Quadrant

Re: How to install Mate Compiz and Docky on Centos 7

Post by Nux » 2014/08/13 11:23:35

Hello,

Can you detail which packages are needed from F19/Rforce/etc that are not in my repo? I'd like to add them if possible so we avoid this repo "stew".
--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

gyoramg
Posts: 4
Joined: 2014/07/19 10:47:38

Re: How to install Mate Compiz and Docky on Centos 7

Post by gyoramg » 2014/08/14 17:38:19

Hello Nux,
First of all, thank you for the excelent work you are doing. Without it I would never try to use CentOS as a desktop.

Nothing connected to compiz or docky is taken from elrepo or rpmforge. The only reason I added those, is to be able to install graphic drivers e.g. for nvidia (from elrepo) and some nostalgic stuff like putty from rpmforge

For compiz, here are the packages required from Fedora19/Fedora19-updates:
compiz-manager-0.6.0-18.fc19.noarch
ccsm-0.8.4-14.fc19.noarch
compizconfig-python-0.8.4-8.fc19.x86_64n
libcompizconfig-0.8.8-8.fc19.x86_64

My script also installs fusion-icon compiz-plugins-main and compiz-plugins-extra but those are not required for the base stuff like rotating cube and wobling windows.

For docky the following were installed from Fedora19/Fedora19-updates:
docky-2.2.0-1.fc19.x86_64
dbus-sharp-0.7.0-7.fc19.x86_64
dbus-sharp-glib-0.5.0-5.fc19.x86_64
gio-sharp-0.3-6.fc19.x86_64
gnome-desktop-sharp-2.26.0-18.fc19.x86_64
gnome-keyring-sharp-1.0.1-0.12.133722svn.fc19.x86_64
gnome-sharp-2.24.2-2.fc19.x86_64
ndesk-dbus-0.6.1a-14.fc19.x86_64
ndesk-dbus-glib-0.4.1-14.fc19.x86_64
notify-sharp-0.4.0-0.20.20100411svn.fc19.x86_64
python-sexy-0.1.9-17.fc19.x86_64

Two more packeges: gtk-sharp2 and mono-addins that docky needs are already in your repo.
There should be no problem to rpmbuild all the Docky requirements on CentOS 7 from fedora19 sources.

By the way, I created a CentOS 7 live dvd with Mate desktop and no Gnome 3 (1,3GB). nux-dextop and epel repos are already defined in it. If some one has a place where I can publish it, I will be glad to share it and the kickstart file I used.

Yoram

User avatar
ongoto
Posts: 6
Joined: 2014/08/15 08:38:33
Location: USA

Re: How to install Mate Compiz and Docky on Centos 7

Post by ongoto » 2014/08/15 08:50:13

Hello gyoramg
Nice job on this script. I had no problem whatsoever.
Thank you

To make things a little more desktopish (and to help me remember), I added a few lines to my copy to enable login sound and to give a systemd hint for runlevel 3.
Like so:

---
### Be sure we are at runlevel 3
...
echo "Or for systemd users"
echo "As root, type the command 'systemctl set-default multi-user.target' in a shell"
...
___

### Provide login sound
#
cat > /etc/xdg/autostart/libcanberra-login-sound.desktop << EOF
[Desktop Entry]
Terminal=false
Type=Application
Name=Login Sound
Comment=Plays a sound at startup
Exec=/usr/bin/canberra-gtk-play --id="service-login" --description="GNOME Login"
AutostartCondition=GSettings org.gnome.desktop.sound event-sounds
Autostart-enabled=true
OnlyShowIn=MATE;GNOME;
EOF
---

Long live Mate :)

Edit: I forgot to mention. You can get 2GB of storage at http://ge.tt/. I have ISOs there for couple years.
-- Only a penguin could make a nest out of some rocks --

erroneus0
Posts: 2
Joined: 2014/07/13 03:17:26

Re: How to install Mate Compiz and Docky on Centos 7

Post by erroneus0 » 2014/11/03 09:47:15

I hate that I am arriving late into this game and I presume changes in RHEL7/CentOS7 through updates are largely responsible for it. But I completed a fresh install of CentOS7 with updates and then ran the script. It seemed to have run just fine but a GUI would not start after that. I made no changes or selected no options within the script. I don't presently have time or focus to dig into what has gone wrong and I don't have the benefit of having seen it gone right so I don't know what to expect. It seems clear I am supposed to drop to runlevel 3, run the script and after some processing, it should start up X and all that again after a reboot. It didn't come back to a graphical environment again.

Fortunately, I am doing only fresh and clean installs, no upgrades or any such complication. I'm willing to provide any data resulting from this requested.

expaddy
Posts: 8
Joined: 2013/04/26 09:52:01

Re: How to install Mate Compiz and Docky on Centos 7

Post by expaddy » 2015/05/11 19:49:12

@ gyoramg

Great job mate, it works a treat on centos 7.1 3.10.0-229.1.2.el7.x86_64 and NVIDIA Driver Version:346.59.
I already had the nvidia driver in and was prepared to do a reinstall as I'm still only setting my system up and all went well.
Everything still working and looking mighty fine.
The only thing I did extra was to exclude kernel updates to prevent heartache with the nvidia drivers.

Thank you muchly

maheshdrao
Posts: 4
Joined: 2014/08/27 09:39:25

Re: How to install Mate Compiz and Docky on Centos 7

Post by maheshdrao » 2015/08/23 01:16:22

Hello Gyoramg,

Thank you for sharing the script. Nice work.
Tried compiz on CentOS 7.1. Works Great ! However had to make two changes with the script under the section for fedora19.repo. baseurl=http://ftp.kaist.ac.kr/fedora//archive/ ... x86_64/os/ and to baseurl=http://ftp.kaist.ac.kr/fedora//archive/ ... 19/x86_64/.

Post Reply

Return to “CentOS 7 - Software Support”