Fink & Apple's X11

      / Essential Reading /


You heard about Open Source, XFree86, Fink, XDarwin, Apple's X11 and you are a Unix beginner. Now you decided to give it a try and play with all these new things. Many of them you may not understand...and you wish that the information available was written simply and clearly.

What I learned is that it's not an easy subject, and that if you have no prior Unix knowledge, it's even worse. The truth is, even these pages, written with beginners in mind, will still require a great effort to gain understanding, as it is not an easy process.



Contents

X11
XFree86
MacOS X
Darwin
MacOS X and X11
XDarwin
Apple's X11 1.0 (Panther)
Installing Apple's X11 and Fink in Panther
Previous Fink installation and Apple's X11 1.0 in 10.3
About Fink
About FinkCommander
Installing XFree86
Setting your PATH
Window Manager
The .xinitrc file
Fink is a volunteer effort
Configuring Fink to use unstable
Dedication



X11

X11 is a graphics display system with a network-transparent client-server architecture.

It allows applications to draw pixels, lines, text, images, etc. on your screen. X11 also comes with additional libraries that let applications easily draw user interfaces, i.e. buttons, text fields, and so on. X11 is the de facto standard graphics system in the Unix world.





XFree86

XFree86 is an Open-Source implementation of X11. It's available free of charge and redistributable.

It runs on UNIX(R) and UNIX-like operating systems such as Linux, all of the BSD variants, Sun Solaris x86, Mac OS X (via Darwin), as well as other platforms like OS/2 and Cygwin.

XFree86 is:

platform-independent
network-transparent
extensible


It provides a client/server interface between display hardware (the mouse, keyboard, and video displays) and the desktop environment while at the same time providing both the windowing infrastructure and a standardized application interface (API).

It supports freedom of the user desktop, meaning that you can customise and personalise your desktops with the application of your choice, whether it be KDE, GNOME, Enlightenment, Blackbox, AfterStep, fvwm or twm.





MacOS X

Is a UNIX-based operating system produced by Apple Computer, and offers a unique combination of technical elements. The graphics engine in MacOS X is called Quartz and the look and feel is called Aqua.

The latest release from Apple, MacOS X 10.3 (Panther), integrates features from state-of-the-art FreeBSD 5 into Darwin, the Open Source base of Mac OS X, which means we can use key applications on top of a state-of-the art BSD UNIX implementation.





Darwin

Darwin is the Open Source release of the Mac OS X operating system. Is available free of charge and with full source code. It does not contain Quartz, Aqua, or any other related technology.





MacOS X and X11 (XFree86) work together

In X11, the top window, called the root window, is the size of the screen and contains all other windows and also the desktop background. As a stand alone graphical environment it has full control over the screen.

In MacOS X it is Quartz (the graphics engine) who has full control of the screen.

There are 2 ways for making these environments work together:

1.Fullscreen (rooted mode)
The two environments take turns and each of them take full control of the screen. We see only one at a time, but it's very easy to switch between them.

2.Rootless mode
Mixing the two environments. Letting Quartz take care of the desktop background, eliminating the X11 top window or root window. That's why this mode is called 'rootless'. This way eliminates the need to switch between two screens.





XDarwin

XDarwin provides the mechanism for switching which graphics system controls the screen. XDarwin is the name of the X server which runs on systems using Darwin or Mac OS X.

Double clicking on the XDarwin.app will show you a dialog window where you can choose between 'fullscreen' and 'rootless' mode.

In XDarwin Preferences, you can set XDarwin to always use the mode of your choice and disable the startup dialog.

Or to start from the terminal.app you can type either:

startx -- -fullscreen
or
startx -- -rootless

Through rootless mode, it allows Xclients to display windows on the Aqua desktop.

In fullscreen mode now we can choose different settings than Aqua for depth, size and screen refresh rate.

The latest release added Xinerama support and the keymap setup is improved for international keyboards.





Apple's X11 1.0 (Panther)

Apple released with Panther a custom "X11" implementation based on XFree86-4.3 which includes Quartz rendering and accelerated OpenGL. Apple's X11 for Mac OS X is compatible, fast and fully integrated with Mac OS X. You can activate X11 applications directly from the Dock, double-click applications directly in the Finder. It supports rootless and full screen mode, and includes the quartz-wm, libraries, basic utilities such as xterm and supports ssh tunnelling.

For more info:

Apple's X11 Page
X11 for Mac OS X discussion list (x11-users)
The F.A.Q. for X11 for Mac OS X
Get X11 for Mac OS X
forums.macosxhints.com X11 FAQ






Installing Apple's X11 and Fink in Panther

Install first Apple's X11 1.0 from the Panther CD, XCode and the X11SDK.pkg from the Xcode Tools CD. You can also download X11 from:
Apple X11 web page.

-Download and install Fink "Binary" release.
And follow the indications on the Fink download page.

or

-Download and install Fink "Source" release.
Installation and usage instructions are inside the distribution tarball.

Since Fink version 0.15.0 or higher, you do not need to install system-xfree86 anymore. Fink is capable of automatically determining your system-xfree86 version if you don't already have any fink x11 packages installed.





Previous Fink installation and Apple's X11 1.0 in 10.3

If you installed Panther with the 'archive and install' method, and then installed Apple's X11 1.0 and the X11 SDK, be sure to install XCode from the XCode disk before upgrading Fink.

Then, running "fink selfupdate" should perform the upgrade for you. The latest version of the fink package manager will automatically detect which version of OS X and which version of gcc you have installed, and will adjust itself accordingly.

If you currently have an old system-xfree86 package of any kind installed, please run the following commands:

sudo dpkg -r --force-all system-xfree86 system-xfree86-42 system-xfree86-43;
fink selfupdate; fink index

(The command all in one line)





About Fink

Fink is free, fast and reliable. It offers the easiest and most painless install of Xwindows on macOS X. Fink currently lists in its database 3247 packages in 22 sections you could install, including the unstable tree and the latest packages from CVS (as 18-01-04). And, thanks to the hard work of the Fink developers, the fink packages seem to get updated fairly quickly to follow the updates in the basic unix source. If you feel you don't need fink anymore, it's extremely easy to uninstall, as it keeps all the things at one place. Fink has support 24/7 through the fink-mailing lists. Give it a try and start installing at your heart's content. You can't go wrong with it, and you will learn things.

Fink developers are porting Open Source Unix software so it can run in MacOS X. To install the software Fink uses package management tools ported over from Linux:

apt-get, dselect,

and it's own tool named ...'fink'

Using Fink to install packages

You can choose between two installing models:

1-Pre-compiled binary packages

2-The source distribution



1-Pre-compiled binary packages

When you install a binary package what you get is a:

ready to run program

Saving you the time for compiling.

The Tools used to install pre-compiled binary packages are:

apt-get
and
dselect

Apt-get or dselect only know about packages available as precompiled binary packages.

The binary distribution of Fink uses the .deb package format. The packages are tailor-made for Mac OS X / Darwin and don't use the Debian source package format.


2-The source distribution
To install packages from source with Fink, you need the Apple Developer Tools (Xcode) installed. Install Xcode from the Xcode Tools CD that came with Panther or after you register for free, you can get them from the:

Apple Developer Connection

If you install from source you have the advantage to usually get newer software. You get to test the latest packages, and as Fink is a volunteer effort, you can then provide feedback through the fink mailing lists and report both success and failure to the package maintainer.

When you buy commercial software you don't get to see the source code (companies treat it as a trade secret). In Open Source software, the source code is open for anyone to see and modify.

With Fink, you can install packages from source, using its own tool named 'fink'.

So, if you run in terminal:

fink install 'packagename'

Fink will figure out what dependencies are involved, ask if you would like to install them too, then after you say 'Yes' it will download everything.

For each package, it will unpack it, apply any needed patches, auto-configure, compile, test, and install into a .deb file which gets installed for you by dpkg.

Compared to binary installs it's a slow process -- but it can be much more reliable in many cases.





About FinkCommander

For those who want to stay away from the CLI, there is an excellent piece of software called FinkCommander, made by Steven Burr, that provides a GUI front end to Fink.

FinkCommander web site

"FinkCommander is a graphical user interface for the Fink software packaging system for Mac OS X. It provides an intuitive front-end to the Fink command-line tools for downloading and installing Unix software".





Installing XFree86

XFree86 is a free X11 implementation that supports Darwin and Mac OS X. Fink will let you install XFree86 in any way you like. In Panther you can install it from the official Xfree86 Project, or install Apple's X11 implementation, based on Xfree86-4.3, or use Fink to install it's own Xfree86 packages.

-Fink own XFree86 packages:
If you have Panther (10.3) installed, install the 'xfree86' package version -4.3.99.15-1 or later (currently in 10.3/unstable). This is a prerelease for XFree86-4.4.

If you are still using Jaguar (10.2), please check the latest Fink versions of the 'xfree86-base' and 'xfree86-rootless' packages. They install the XFree86 libraries, utilities, clients and data. This will let you run X11 applications and desktop environments.


-XFree86 Project:
Is the organisation which produces XFree86», a freely redistributable open-source implementation of the X Window System. The upcoming 4.4.0 release is expected to be the basis for future releases of Apple's X11. XFree86 4.4.0 provides identical performance to Apple's X11 on Panther and is fully compatible with quartz-wm.

Prebuilt binaries for Panther

Download all *.tgz files, Xinstall.sh, and extract. Then run "sudo sh Xinstall.sh" from the directory you downloaded to. This will install everything for you.


-The Xonx Project:
"The XonX project is used by developers of XFree86 for Darwin and Mac OS X to share and distribute code and information. All of the code developed is committed to the XFree86 Project's CVS server".

A GUI installer of XFree86 4.3.0

is available only for Mac OS X 10.2.x (Jaguar). The binaries installed are identical to what is available directly from the XFree86 Project. However, this release is packaged in a Mac OS X friendly installer.


-Apple's X11 implementation:
If you have Panther (10.3) installed, you can install the release version of Apple's X11 based on Xfree86-4.3 which is available as optional install from the Panther CD. Under fink-0.16.2, you will also need to install the "X11SDK" package. Then Fink will create a system-xfree86 virtual package. If you're 'only' installing binary packages with fink-0.17.0 or later installed, system-xfree86 no longer requires the "X11SDK".





Setting your PATH environment variable

To use the software you installed with Fink, you must set your PATH environment variable. You can do this via the command:

open /sw/bin/pathsetup.command

If that doesn't work, you can configure it manually depending on the shell you are using:

-If you use bash (the default shell in Panther), or other variant of the Bourne style shell, like sh or zsh, add the following lines to your .profile or .bash_profile in your home directory:

source /sw/bin/init.sh

If you don't have a .profile file, you can create it by running from Terminal.app the following commands:

cd (to go to your home directory)

pico .profile (to open the text editor Pico, and create a file named .profile)

When the text editor open, type:

source /sw/bin/init.sh

at the end of the line press Return once.

Then press Control-O, Return, and control-X

to save the file and return to the prompt.

Now you should type rehash or close-open the terminal window.

------

-If you use tcsh (the default shell in Jaguar), add the following line to the .cshrc file in your home directory:

source /sw/bin/init.csh

If you don't have a .cshrc file, you can create it by running from Terminal.app the following commands:

cd (to go to your home directory)

pico .cshrc (to open the text editor Pico, and create a file named .cshrc)

When the text editor open, type:

source /sw/bin/init.csh

at the end of the line press Return once.

Then press Control-O, Return, and control-X

to save the file and return to the prompt.

Now you should type rehash or close-open the terminal window.

Attention:
If you use tcsh and happen to have a .tcshrc file in your home directory, this file will be read instead of your .cshrc file. In this case, you can write 'source /sw/bin/init.csh' in your .tcshrc file instead, or add 'source ~/.cshrc' at the end of your .tcshrc file.

The scripts also add /usr/X11R6/bin and /usr/X11R6/man to your path so you can use X11 when it is installed.





Window Manager

To work in X11 we need to install a window manager.

These are the programs that provide the window frames (title bar, close button, etc. also called "decorations"). Most window managers provide additional functionality, like pop up menus in the root window, docks or launch buttons and many of them allow you to customize their appearance with themes.

Apple's X11 includes 'quartz-wm' it's own window manager. But, it is possible to run another window manager instead of 'quartz-wm' with Apple's X11.

Refer to the Window Mgrs page to see which window managers are available for installation with Fink.





The .xinitrc file

The .xinitrc file is a shell script that runs when you start the X11 system (or when it automatically starts for you).

This file contains the commands to define which applications are started when your X11 system boots up.

By default, when no ~/.xinitrc file is found, the Apple's X11.app for example, starts the X server, launch the quartz-wm and open one naked unconfigured xterm window. But if you have a ~/.xinitrc file, Apple's X11.app start the X server and the applications you specified in your ~/.xinitrc file, and then stay in the background, giving you a better control of the hundreds of possible startup parameters.

The ~/.xinitrc file contains, for example, the commands to start the window manager, some xterms or a desktop environment (like GNOME or KDE), along with various command line options to control their behavior or appearance, such as setting sizes, background colors, fonts, etc.

If you want to run a bunch of apps at launch, add them to your .xinitrc file and add 'exec quartz-wm' if you want them to run with Apple's window manager. If you want Apple's X11 to run with another window manager, add 'exec wmanagername' to your .xinitrc file.

What is typically done is to start applications in the background and then finally start the window manager in the foreground. In this way, when exit from the window manager, the .xinitrc script exits and the X11 system goes away.

When the .xinitrc script exits, the X11 system will close down and allow you to logout.

You will find XFree86 xinitrc default file in:

/private/etc/X11/xinit/xinitrc

To use it as a starting point for your own .xinitrc file, copy the file to your home directory:

cp /private/etc/X11/xinit/xinitrc ~/.xinitrc

Then, you can edit it with your own choices.

Some simple .xinitrc examples:

To start 'autocutsel' and Windowmaker-wm:
source /sw/bin/init.sh

autocutsel &

exec wmaker

To start an xterm and Apple's quartz-wm:
source /sw/bin/init.sh

xterm -geometry 75x34+687+40 &

exec quartz-wm

To start Gnome:
source /sw/bin/init.sh

exec gnome-session

To start KDE and the KDE window manager:
source /sw/bin/init.sh

export KDEWM=kwin

/sw/bin/startkde >/tmp/kde.log 2>&1

To start blackbox-wm and other apps. at launch:
source /sw/bin/init.sh

quartz-wm --only-proxy &

xterm -geometry 75x34+687+40 &
multi-gnome-terminal --geometry 75x34+687+40 &

wmCalClock &
wmMoonClock &
wmSpaceWeather &
gkrellm -w &

exec blackbox

If you start quartz-wm with the option --only-proxy like in the above ~/.xinitrc file, Apple's X11 will let you use another window manager, but the 'cut and paste' is handled by quartz-wm.





Fink is a volunteer effort

There are packages in the fink stable and unstable sections. The former is called "unstable" because these packages are not well-tested.

As I mentioned before, apt-get or dselect only know about packages available as precompiled binary packages. Many packages are not available in precompiled form for a variety of reasons, one of them being that a package must be in the "stable" section of the latest point release to be considered.

One of the ways we all can help is by testing the packages from unstable. If nobody tested them, it will take longer for them to be upgraded to the stable section.

In order to 'test' a package you need:

The Developer Tools installed
To compile it from source using 'fink install packagename'
The latest descriptions from CVS
To configure Fink to use unstable


Right now there are about 1412 packages (18-01-04) that need testing and feedback.


List of Packages that need testing





To configure Fink to use unstable

If you only want one or two specific packages:

You need to switch over to CVS updating, because rsync only updates the trees that are active in your fink.conf. If not present, add 'local/main' to the Trees: line in /sw/etc/fink.conf, then run 'fink selfupdate' to download the package description files.

And copy the .info files and their associated .patch files from:

/sw/fink/dists/unstable/main/finkinfo
to
/sw/fink/dists/local/main/finkinfo

Your package may depend on other packages which are also only in 'unstable' and you will have to move their .info and .patch files as well. After you move all of the files, then, run 'fink index'.


If you want Fink to use all of unstable:

edit

/sw/etc/fink.conf

and add:

unstable/main unstable/crypto

to the beginning of the Trees: line.

And then run the command:

fink index

I chose to configure fink to use all of unstable.

The Trees:line in my fink.conf file looks like this:

Trees: local/main unstable/main unstable/crypto stable/main stable/crypto local/bootstrap





Dedication

It all started with MacOS X Public Beta. Suddenly, X became part of my daily vocabulary. MacOS X opened the world of Unix, and as an old Macintosh user who knew nothing about it, I started a journey of discovery, searching for tutorials throughout the Web.

Then, I found the "MacOS X Hints" Web site. The work done there by Rob Griffiths inspired and encouraged me. Through his excellent "XFree86 Installation Guide" I was introduced to the concept of "open source" and "Fink". In the end, I got so much from Rob's work and ideas that I felt I had to give something back -- thus, the making of this site.

Talking about inspiration, I came to realize how grateful I am to a bunch of people..."the Fink developers". In this time and age, where greed rules, I'm amazed at the great work they do. They work for free, dedicating their time and effort to the open source community. Time after time, I have gone to them with problems, and they have always patiently helped me find solutions. I have now installed more than 1,000 packages, something I could never have done without Fink. So, my gratitude and thanks go to...


               ...the Fink developers and Rob Griffiths.




astronaut / Make Contact /
drop me a line at:           sao1@mac.com

MacOS X,    Fink,    X11,    Unix       ...and other related things