Moving Compiz to a local overlay in Gentoo

Sadly, Compiz’s heyday has passed and the Compiz ebuilds in the Gentoo Portage main tree were recently masked for removal. I rarely use Compiz these days, as KWin’s Desktop Effects are now almost as good. Nevertheless I want to keep Compiz installed for the time being, so I decided to move the ebuilds to a local overlay before the Gentoo developers remove them from the main Portage tree. Here’s how I did it.

The masked Compiz packages installed on my machine were:

# eix -I compiz
[D] dev-python/compizconfig-python
Available versions: [M](~)0.8.4 [M](~)0.8.4-r1 [M](~)0.8.4-r3
Installed versions: 0.8.4-r3(00:52:18 01/09/11)
Homepage: http://www.compiz.org/
Description: Compizconfig Python Bindings

[D] x11-libs/compiz-bcop
Available versions: [M](~)0.8.4
Installed versions: 0.8.4(23:33:17 27/08/11)
Homepage: http://www.compiz.org/
Description: Compiz Option code Generator

[D] x11-libs/compizconfig-backend-gconf
Available versions: [M](~)0.8.4-r2
Installed versions: 0.8.4-r2(18:39:26 27/08/11)
Homepage: http://www.compiz.org/
Description: Compizconfig Gconf Backend

[D] x11-libs/compizconfig-backend-kconfig4
Available versions: [M](~)0.8.4 {aqua}
Installed versions: 0.8.4(23:35:31 27/08/11)(-aqua -kdeenablefinal)
Homepage: http://www.compiz.org/
Description: Compizconfig Kconfig Backend

[D] x11-libs/libcompizconfig
Available versions: [M](~)0.8.4-r2!t
Installed versions: 0.8.4-r2!t(18:32:41 27/08/11)
Homepage: http://www.compiz.org/
Description: Compiz Configuration System

[D] x11-plugins/compiz-plugins-extra
Available versions: [M](~)0.8.6-r1 {gconf libnotify}
Installed versions: 0.8.6-r1(23:35:08 27/08/11)(libnotify -gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Extra Plugins

[D] x11-plugins/compiz-plugins-main
Available versions: [M](~)0.8.6-r1 {gconf}
Installed versions: 0.8.6-r1(18:33:51 27/08/11)(-gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Plugins

[D] x11-plugins/compiz-plugins-unsupported
Available versions: [M](~)0.8.4-r1!m
Installed versions: 0.8.4-r1!m(18:36:55 27/08/11)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Unsupported Plugins

[D] x11-wm/compiz
Available versions: [M](~)0.8.6-r3 {+cairo fuse gconf gnome gtk kde +svg}
Installed versions: 0.8.6-r3(18:54:59 23/11/11)(cairo gtk kde svg -fuse -gconf -gnome)
Homepage: http://www.compiz.org/
Description: OpenGL window and compositing manager

[D] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 [M](~)0.8.6 {emerald gnome kde unsupported}
Installed versions: 0.8.6(18:55:16 23/11/11)(emerald kde -gnome -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

Found 10 matches.
# eix -I fusion
[D] x11-apps/fusion-icon
Available versions: [M](~)0.1-r2 {gtk qt4}
Installed versions: 0.1-r2(18:55:09 23/11/11)(gtk qt4)
Homepage: http://compiz-fusion.org
Description: Compiz Fusion Tray Icon and Manager

[D] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 [M](~)0.8.6 {emerald gnome kde unsupported}
Installed versions: 0.8.6(18:55:16 23/11/11)(emerald kde -gnome -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

Found 2 matches.
# eix -I ccsm
[D] x11-apps/ccsm
Available versions: [M](~)0.8.4-r1
Installed versions: 0.8.4-r1(23:33:31 27/08/11)
Homepage: http://www.compiz.org/
Description: Compizconfig Settings Manager

# eix -I emerald
[D] x11-themes/emerald-themes
Available versions: [M](~)0.5.2
Installed versions: 0.5.2(18:47:58 27/01/11)
Homepage: http://compiz-fusion.org
Description: Emerald window decorator themes

[D] x11-wm/emerald
Available versions: [M](~)0.8.4-r2
Installed versions: 0.8.4-r2(21:28:46 27/08/11)
Homepage: http://www.compiz.org/
Description: Emerald Window Decorator

Found 2 matches.

Using the locate command I quickly located the ebuilds:

/usr/portage/dev-python/compizconfig-python/compizconfig-python-0.8.4-r3.ebuild
/usr/portage/x11-libs/compiz-bcop/compiz-bcop-0.8.4.ebuild
/usr/portage/x11-libs/compizconfig-backend-gconf/compizconfig-backend-gconf-0.8.4-r2.ebuild
/usr/portage/x11-libs/compizconfig-backend-kconfig4/compizconfig-backend-kconfig4-0.8.4.ebuild
/usr/portage/x11-libs/libcompizconfig/libcompizconfig-0.8.4-r2.ebuild
/usr/portage/x11-plugins/compiz-plugins-extra/compiz-plugins-extra-0.8.6-r1.ebuild
/usr/portage/x11-plugins/compiz-plugins-main/compiz-plugins-main-0.8.6-r1.ebuild
/usr/portage/x11-plugins/compiz-plugins-unsupported/compiz-plugins-unsupported-0.8.4-r1.ebuild
/usr/portage/x11-wm/compiz/compiz-0.8.6-r3.ebuild
/usr/portage/x11-wm/compiz-fusion/compiz-fusion-0.8.6.ebuild
/usr/portage/x11-apps/fusion-icon/fusion-icon-0.1-r2.ebuild
/usr/portage/x11-apps/ccsm/ccsm-0.8.4-r1.ebuild
/usr/portage/x11-themes/emerald-themes/emerald-themes-0.5.2.ebuild
/usr/portage/x11-wm/emerald/emerald-0.8.4-r2.ebuild

I first created the necessary directories in my local overlay:

# mkdir -p /usr/local/portage/dev-python/compizconfig-python
# mkdir -p /usr/local/portage/x11-libs/compiz-bcop
# mkdir -p /usr/local/portage/x11-libs/compizconfig-backend-gconf
# mkdir -p /usr/local/portage/x11-libs/compizconfig-backend-kconfig4
# mkdir -p /usr/local/portage/x11-libs/libcompizconfig
# mkdir -p /usr/local/portage/x11-plugins/compiz-plugins-extra
# mkdir -p /usr/local/portage/x11-plugins/compiz-plugins-main
# mkdir -p /usr/local/portage/x11-plugins/compiz-plugins-unsupported
# mkdir -p /usr/local/portage/x11-wm/compiz
# mkdir -p /usr/local/portage/x11-wm/compiz-fusion
# mkdir -p /usr/local/portage/x11-apps/fusion-icon
# mkdir -p /usr/local/portage/x11-apps/ccsm
# mkdir -p /usr/local/portage/x11-themes/emerald-themes
# mkdir -p /usr/local/portage/x11-wm/emerald

Then I copied the ebuilds and associated files into each directory and generated a manifest for each:

# cd /usr/local/portage/dev-python/compizconfig-python
# cp -r /usr/portage/dev-python/compizconfig-python/* .
# ebuild compizconfig-python-0.8.4-r3.ebuild manifest
# cd /usr/local/portage/x11-libs/compiz-bcop
# cp -r /usr/portage/x11-libs/compiz-bcop/* .
# ebuild compiz-bcop-0.8.4.ebuild manifest
# cd /usr/local/portage/x11-libs/compizconfig-backend-gconf
# cp -r /usr/portage/x11-libs/compizconfig-backend-gconf/* .
# ebuild compizconfig-backend-gconf-0.8.4-r2.ebuild manifest
# cd /usr/local/portage/x11-libs/compizconfig-backend-kconfig4
# cp -r /usr/portage/x11-libs/compizconfig-backend-kconfig4/* .
# ebuild compizconfig-backend-kconfig4-0.8.4.ebuild manifest
# cd /usr/local/portage/x11-libs/libcompizconfig
# cp -r /usr/portage/x11-libs/libcompizconfig/* .
# ebuild libcompizconfig-0.8.4-r2.ebuild manifest
# cd /usr/local/portage/x11-plugins/compiz-plugins-extra
# cp -r /usr/portage/x11-plugins/compiz-plugins-extra/* .
# ebuild compiz-plugins-extra-0.8.6-r1.ebuild manifest
# cd /usr/local/portage/x11-plugins/compiz-plugins-main
# cp -r /usr/portage/x11-plugins/compiz-plugins-main/* .
# ebuild compiz-plugins-main-0.8.6-r1.ebuild manifest
# cd /usr/local/portage/x11-plugins/compiz-plugins-unsupported
# cp /usr/portage/x11-plugins/compiz-plugins-unsupported/* .
# ebuild compiz-plugins-unsupported-0.8.4-r1.ebuild manifest
# cd /usr/local/portage/x11-wm/compiz
# cp -r /usr/portage/x11-wm/compiz/* .
# ebuild compiz-0.8.6-r3.ebuild manifest
# cd /usr/local/portage/x11-wm/compiz-fusion
# cp -r /usr/portage/x11-wm/compiz-fusion/* .
# ebuild compiz-fusion-0.8.6.ebuild manifest
# cd /usr/local/portage/x11-apps/fusion-icon
# cp -r /usr/portage/x11-apps/fusion-icon/* .
# ebuild fusion-icon-0.1-r2.ebuild manifest
# cd /usr/local/portage/x11-apps/ccsm
# cp -r /usr/portage/x11-apps/ccsm/* .
# ebuild ccsm-0.8.4-r1.ebuild manifest
# cd /usr/local/portage/x11-themes/emerald-themes
# cp -r /usr/portage/x11-themes/emerald-themes/* .
# ebuild emerald-themes-0.5.2.ebuild manifest
# cd /usr/local/portage/x11-wm/emerald
# cp -r /usr/portage/x11-wm/emerald/* .
# ebuild emerald-0.8.4-r2.ebuild manifest

My /etc/make.conf file contains the following lines required for my local overlay and to accept any licences:

PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage/"
ACCEPT_LICENSE="*"

and I named my local overlay ‘local_overlay’:

# mkdir /usr/local/portage/profiles
# echo "local_overlay" > /usr/local/portage/profiles/repo_name

I then unmasked the ebuilds in my local overlay by listing them in the file /etc/portage/package.unmask:

=dev-python/compizconfig-python-0.8.4-r3::local_overlay
=x11-libs/compiz-bcop-0.8.4::local_overlay
=x11-libs/compizconfig-backend-gconf-0.8.4-r2::local_overlay
=x11-libs/compizconfig-backend-kconfig4-0.8.4::local_overlay
=x11-libs/libcompizconfig-0.8.4-r2::local_overlay
=x11-plugins/compiz-plugins-extra-0.8.6-r1::local_overlay
=x11-plugins/compiz-plugins-main-0.8.6-r1::local_overlay
=x11-plugins/compiz-plugins-unsupported-0.8.4-r1::local_overlay
=x11-wm/compiz-0.8.6-r3::local_overlay
=x11-wm/compiz-fusion-0.8.6::local_overlay
=x11-apps/fusion-icon-0.1-r2::local_overlay
=x11-apps/ccsm-0.8.4-r1::local_overlay
=x11-themes/emerald-themes-0.5.2::local_overlay
=x11-wm/emerald-0.8.4-r2::local_overlay

I right-clicked on the Fusion Icon on the Panel and selected Quit, then I uninstalled the packages and reinstalled them from my local overlay:

# emerge -aC compizconfig-python compiz-bcop compizconfig-backend-gconf compizconfig-backend-kconfig4 libcompizconfig compiz-plugins-extra compiz-plugins-main compiz-plugins-unsupported compiz compiz-fusion fusion-icon ccsm emerald-themes emerald

# USE="-kde qt4" emerge -1v compizconfig-python compiz-bcop compizconfig-backend-gconf compizconfig-backend-kconfig4 libcompizconfig compiz-plugins-extra compiz-plugins-main compiz-plugins-unsupported compiz compiz-fusion fusion-icon ccsm emerald-themes emerald

The installed packages are now:

# eix -I compiz
[I] dev-python/compizconfig-python
Available versions: [M](~)0.8.4 {M}(~)0.8.4[1] [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1] [M](~)0.8.4-r3 {M}(~)0.8.4-r3[1]
Installed versions: 0.8.4-r3[1](02:03:18 28/01/12)
Homepage: http://www.compiz.org/
Description: Compizconfig Python Bindings

[I] x11-libs/compiz-bcop
Available versions: [M](~)0.8.4 {M}(~)0.8.4[1]
Installed versions: 0.8.4[1](02:01:00 28/01/12)
Homepage: http://www.compiz.org/
Description: Compiz Option code Generator

[I] x11-libs/compizconfig-backend-gconf
Available versions: [M](~)0.8.4-r2 {M}(~)0.8.4-r2[1]
Installed versions: 0.8.4-r2[1](02:03:34 28/01/12)
Homepage: http://www.compiz.org/
Description: Compizconfig Gconf Backend

[I] x11-libs/compizconfig-backend-kconfig4
Available versions: [M](~)0.8.4 {M}(~)0.8.4[1] {aqua}
Installed versions: 0.8.4[1](02:03:59 28/01/12)(-aqua)
Homepage: http://www.compiz.org/
Description: Compizconfig Kconfig Backend

[I] x11-libs/libcompizconfig
Available versions: [M](~)0.8.4-r2!t {M}(~)0.8.4-r2!t[1]
Installed versions: 0.8.4-r2!t[1](02:01:31 28/01/12)
Homepage: http://www.compiz.org/
Description: Compiz Configuration System

[I] x11-plugins/compiz-plugins-extra
Available versions: [M](~)0.8.6-r1 {M}(~)0.8.6-r1[1] {gconf libnotify}
Installed versions: 0.8.6-r1[1](02:05:19 28/01/12)(libnotify -gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Extra Plugins

[I] x11-plugins/compiz-plugins-main
Available versions: [M](~)0.8.6-r1 {M}(~)0.8.6-r1[1] {gconf}
Installed versions: 0.8.6-r1[1](02:02:55 28/01/12)(-gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Plugins

[I] x11-plugins/compiz-plugins-unsupported
Available versions: [M](~)0.8.4-r1!m {M}(~)0.8.4-r1!m[1]
Installed versions: 0.8.4-r1!m[1](02:06:11 28/01/12)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Unsupported Plugins

[I] x11-wm/compiz
Available versions: [M](~)0.8.6-r3 {M}(~)0.8.6-r3[1] {+cairo fuse gconf gnome gtk kde +svg}
Installed versions: 0.8.6-r3[1](02:41:46 28/01/12)(cairo gtk svg -fuse -gconf -gnome -kde)
Homepage: http://www.compiz.org/
Description: OpenGL window and compositing manager

[I] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1] [M](~)0.8.6 {M}(~)0.8.6[1] {emerald gnome kde unsupported}
Installed versions: 0.8.6[1](02:07:11 28/01/12)(emerald -gnome -kde -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

[1] "local_overlay" /usr/local/portage

Found 10 matches.
# eix -I fusion
[I] x11-apps/fusion-icon
Available versions: [M](~)0.1-r2 {M}(~)0.1-r2[1] {gtk qt4}
Installed versions: 0.1-r2[1](02:06:20 28/01/12)(gtk qt4)
Homepage: http://compiz-fusion.org
Description: Compiz Fusion Tray Icon and Manager

[I] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1] [M](~)0.8.6 {M}(~)0.8.6[1] {emerald gnome kde unsupported}
Installed versions: 0.8.6[1](02:07:11 28/01/12)(emerald -gnome -kde -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

[1] "local_overlay" /usr/local/portage

Found 2 matches.
# eix -I ccsm
[I] x11-apps/ccsm
Available versions: [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1]
Installed versions: 0.8.4-r1[1](02:05:30 28/01/12)
Homepage: http://www.compiz.org/
Description: Compizconfig Settings Manager

[1] "local_overlay" /usr/local/portage
# eix -I emerald
[I] x11-themes/emerald-themes
Available versions: [M](~)0.5.2 {M}(~)0.5.2[1]
Installed versions: 0.5.2[1](02:07:05 28/01/12)
Homepage: http://compiz-fusion.org
Description: Emerald window decorator themes

[I] x11-wm/emerald
Available versions: [M](~)0.8.4-r2 {M}(~)0.8.4-r2[1]
Installed versions: 0.8.4-r2[1](02:06:55 28/01/12)
Homepage: http://www.compiz.org/
Description: Emerald Window Decorator

[1] "local_overlay" /usr/local/portage

Found 2 matches.

I launched KRunner (Alt-F2) and entered the command “fusion-icon” (without the quotes) to get the Fusion Icon back on the Panel, and then rebooted to check if everything was working correctly.

The only way I could get compiz-0.8.6-r3 to build this time was to specify "-kde" as a USE flag. The last time I merged that package, back in November 2011, it would build with USE="kde qt4" and enable me to select Emerald, GTK Window Decorator or KDE Window Decorator as the window decorator in Compiz. But, as the package will no longer build with the kde USE flag, I now only have the choice of Emerald or GTK Window Decorator. Perhaps this old, unmaintained compiz ebuild will no longer build with USE="kde" because I have since installed new versions of other packages on which it depends, and/or because I am now using KDE 4.8.0 instead of KDE 4.7.3. Anyway, at least I now have Compiz available for a while yet and can still select KWin or Compiz as the Window Manager.

EDIT (February 1, 2012): The stuff overlay has the following ebuilds, which do enable the KDE4 Window Decorator to be used with Compiz in KDE 4.8.0:

dev-python/compizconfig-python-0.8.4-r3
x11-libs/compiz-bcop-0.8.8
x11-libs/compizconfig-backend-gconf-0.8.8
x11-libs/compizconfig-backend-kconfig4-0.8.8
x11-libs/libcompizconfig-0.8.8
x11-plugins/compiz-plugins-extra-0.8.8
x11-plugins/compiz-plugins-main-0.8.8
x11-plugins/compiz-plugins-unsupported-0.8.8
x11-wm/compiz-0.8.8
x11-wm/compiz-fusion-0.8.8
x11-apps/fusion-icon-0.1-r2
x11-apps/ccsm-0.8.4-r1
x11-themes/emerald-themes-0.5.2
x11-wm/emerald-0.8.8

which can be installed as follows:

# layman -a stuff
# USE="kde qt4" emerge -1v compizconfig-python::stuff compiz-bcop::stuff compizconfig-backend-gconf::stuff compizconfig-backend-kconfig4::stuff libcompizconfig::stuff compiz-plugins-extra::stuff compiz-plugins-main::stuff compiz-plugins-unsupported::stuff compiz::stuff compiz-fusion::stuff fusion-icon::stuff ccsm::stuff emerald-themes::stuff emerald::stuff

Setting up a talking clock easily in Linux

There are several ways to set up a talking clock in Linux. One simple way to do it if you’re a KDE user is to use the Analogue Clock widget. Once you have placed the Analogue Clock widget on your Desktop, click on the widget’s spanner icon, select the ‘General’ tab and it shows the title ‘Text to Speech’ and a ‘Speak time’ box where you can select the frequency at which you want the talking clock to speak the time. When you click ‘Apply’, an icon appears in the System Tray on the Panel: Jovie KDE Text-to-speech Manager. You can right-click on the Jovie icon then click on ‘Configure’ to change the language and voice etc.

Another alternative is to install the eSpeak text-to-speech synthesizer and use the GUI KAlarm utility to run the following command at any interval you like (every hour, every half hour, every 15 minutes or whatever you want):

date +%I:%M%p | espeak

When the command above is executed on the hour, the voice speaks the hour followed by “zero zero AM/PM”. For example it says “seven zero zero PM” rather than “seven o’clock PM”. If you prefer the latter, you can modify the one-line command:

if [ $(date +%M) != "00" ]; then date +%-H:%M%p%Z; else echo -n $(date +%-H); echo -n "oh clock "; date +%p; date +%Z; fi | espeak -ven+f6

Use the command date --help to find out the different parameters available for the date command. You can also play around with the last two characters in the above command to get different voices. For example “m1”, “f4” etc.

Using KAlarm’s GUI is less daunting for many people than setting up a cronjob to run the command, which would be yet another way of doing it. Also, by using KAlarm it is quick and easy to enable and disable the talking clock.

An alternative to the above command would be to run one of the many Bash scripts found on the Web. One such is saytime. SayTime uses the festival text-to-speech engine, an alternative to espeak, which you would need to install. The guts of SayTime is simply the command:

echo "Today is `date +%d` `date +%B` `date +%Y` and now the time is `date +%k` and `date +%M` minutes" | festival --tts

so you could use that command with KAlarm or a cronjob if you wanted. You can play around with the commands to get the time spoken the way you want.

eSpeak is also configurable; check out the Web site eSpeak text to speech. For example, the following is the time spoken in Portuguese instead of English:

date +%I:%M%p | espeak -vpt

or in English with a Scottish accent:

date +%I:%M%p | espeak -ven-sc

or in English with a Brummie accent:

date +%I:%M%p | espeak -ven-wm

or in Latin with a female voice:

date +%I:%M%p | espeak -vla+f4

Three guesses what this one does:

date +%I:%M%p | espeak -ven+whisper

You can have some fun exploring the options.