Comments:
2009-06-25
Clearly, this page is in need of a serious overhaul. In the meantime, please
note that the GNOME project has moved their code from Subversion to Git
(http://git.gnome.org/).[1] So I made a copy of their Git repository on GitHub.
Specifically, the official Metacity repo is currently here:
http://git.gnome.org/cgit/metacity/. I pushed copies of their
master and gnome-2-26 branches to my own metacity
repository on GitHub.
Then I reimplemented my center-placement changes on a new branch called
gnome-2-26-center-placement for the GNOME 2.26 release of Metacity:
http://github.com/ccg/metacity/tree/gnome-2-26-center-placement
I'd be happy to write up instruction on how to straddle two git remote
repositories like that if anybody is interested. If you're a new Git user,
it's probably not immediately obvious how to do something like that. It took
me a few weeks of day-to-day use to become comfortable with Git.
This patch modifies Metacity's window-placement behavior so that it merely centers new windows instead of trying to tile them in groups or cascade them from the upper-left corner.
This patch for Metacity adds a few window-placement options that can be configured in the graphical gconf-editor or with the gconftool-2 command-line program.
The following options are available:
After installing the patched version of Metacity, you can change the option as follows:
In GNOME 2.10, open Configuration Editor from the following menu:
Applications --> System Tools --> Configuration Editor
|
/ --> apps --> metacity --> general
|
To change the option from the command line, do this:
gconftool-2 --type string --set /apps/metacity/general/placement_mode random
|
I like to avoid clutter in my home directory by installing locally built
apps into $HOME/opt/name-version. In this case, it would be something
like $HOME/opt/metacity-2.16.3. After patching the source:
./configure --prefix=$HOME/opt/metacity-2.16.3
make
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
make install
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
I usually point my local copy of metacity at the system-wide theme
directory:
cd ~/opt/metacity-2.16.3/share
mv themes themes.original
ln -s /usr/share/themes .
After running make, you can test your build by running
metacity --replace from the source directory. You should be
able to do this before or after installing.
If everything works, you can make the change permanent by adding a line like
the following to ~/.gnomerc:
export WINDOW_MANAGER=$HOME/opt/metacity-2.16.3/bin/metacity
Building a custom RPM
Good introductory article:
Packaging software with RPM, Part 1
...
Part 2
...
Part 3
In the steps below, 'rpm/' refers to your rpm build directory. I use ~/rpm, as described in the article above. ("%_topdir /home/chad/rpm" in ~/.rpmmacros)
Note:Your setup and commands may be different. This is not written as a copy-and-paste sort of command list. This is just a rough guide.
Patch2: metacity-2.10-window-placement.patch
%patch2 -p1 -b .placement
* Wed Jul 13 2005 Your Name <email@example.com> 2.10.0-2
- Added window-placement patch (http://glendenin.com/chad/metacity/)
Changelog date format: date +"%a %b %d %Y"
cd rpm/SPECS; rpmbuild -ba metacity.spec
cd rpm/RPMS/i386
sudo rpm -Uvh metacity-2.10.0-2.i386.rpm
Building a custom .DEB package (for Debian, Ubuntu, etc.)
Debian Package Customization HOWTO
I did the following on Ubuntu 5.10. Modify as needed for other Debian-based distros.
Make sure these packages are already installed (install them if not):
cd <your build directory>
|
At this point, a text editor will open where you can add an entry to the changelog file. See http://familiasanchez.net/~roberto/howtos/debcustomize for some suggestions. Note the modified release number. My new entry looks like this:
metacity (1:2.12.1-0ubuntu1.0.0.ccg.0) breezy; urgency=low * Non-maintainer upload. * Applied window-placement patch. (http://glendenin.com/chad/metacity/) -- Chad Glendenin <ccg_spam@example.com> Thu, 20 Oct 2005 14:48:27 -0500 |
Copy the patch file (see above) into metacity-2.12.1/debian/patches/. I renamed the patch to 003_placement.patch to appear consistent with the other patches I found in that directory. I don't know if that's really necessary (I doubt it, but I don't care enough to find out). Then in the metacity-2.12.1 directory:
debuild -us -uc
|
PORTDIR_OVERLAY="/usr/local/portage"
|
Create the directory:
mkdir -p /usr/local/portage/x11-wm
|
Copy the official metacity build dir over:
cp -a /usr/portage/x11-wm/metacity /usr/local/portage/x11-wm/
|
Add the patch(es) to the files directory:
cp metacity-2.8.6-window-placement.patch /usr/local/portage/x11-wm/metacity/files/
|
Replace the ebuild file:
cp -f metacity-2.8.6-r1.ebuild /usr/local/portage/x11-wm/metacity/
|
Update the digest/manifest:
ebuild metacity-2.8.6-r1.ebuild digest
|
Now you should be able to rebuild Metacity using the usual Portage tools.