X.Org is an open source project which aim to provides implementation of the X Window System. The development work is being done in conjuction with the freedesktop.org community. The product, X11, is widely used in some operating system such as Linux and FreeBSD.
In this article we will discuss about how to setting up X.org to present Graphical User Interface experience on FreeBSD machine. For this article I use FreeBSD 8.3 for amd64 architecture (x86_64)
An installation to X.org is straightforward like other FreeBSD ports. You can invoke following commands to do installation:
cd /usr/ports/x11/xorg make install clean
The process will take awhile (depending on the speed of machine), so grabbing snacks and drinks is recommended 😉
Once the installation finished, then comes configuration time. The best way to do this is using X.org config script and run it with root privileges.
Things you need to know:
Mouse Protocol – protocol for interact with your mouse. If you don’t know this, then choose either Auto or Sysmouse and in most case it will works.
Emulate 3 Button Protocol – If you have a 3 button mouse, or a mouse with a wheel (counts as a 3rd button). It allows us to paste text with 3rd button. If you choose no, the 3rd button can be represented by both button (left and right).
Mouse Device – Your mouse device, usually /dev/sysmouse. If your mouse is not it, then enter your device name.
Keyboard – Your keyboard
XKB – X11 Keyboard extension. Well it means you can create your custom keyboard layout, but in this case choose no.
Monitor – Most important parts. Please read carefully the specification of your monitor and make sure you give the right commands. Some monitor will tell us hsync and vsync under their menu. Another things to look for is the color depth.
Video card – Your video cards. If you have proprietary video, make sure you have install the driver provided by the vendor.
Video memory – Using unit KB (KiloBytes which you need to multiply by 1024 for MB and multiply it again with 1024 for GB). Normally this is just hashed out in the X.org config file so it is not of high importance to get it right.
Resolutions – Choose some resolutions that are suitable for your display.
Once it finished, it will write the file to /etc/X11/xorg.conf
In some system, X11 can be configured by invoking this command:
Instead of xorgconfig like told before.
Setting up Touch Pad
If you have Touch Pad, then you might also want to configure it. You can follow similar guideline here for Synaptic on Lenovo z480.
You can try invoking command startx to start the X11. If there is no problem then you can see your desktop now. Well, it’s still a simple interface provided by X11. If you want to install rich desktop interface then you can choose one of these:
- Desktop Environtment
- Window Manager
If you have more than 1 Desktop Environment or Window Manager, you can also run one at a time. To select what DE / WM you want to run, you can run xwmconfig and then pick one you like.
When X11 is running, the X11 or X.org will create an initialization script called .xinitrc. The file is on ~/.xinitrc (~ is the current user home directory). And please note the “.” (dot) character in front of the filename which is also parth of the name.
To stop the X.org, press ctrl + alt + backspace simultaneously.
Launching Programs on Startup using ~/.xinitrc
.xinitrc is run whenever X.org starts up. Thus it can be a good place to put everything we want to load at startup regardless of DE and WM. For example you can use it to be something like this:
exec yourapp &
All programs being launched need an & after them so they will run in the background, the window manager however does not. Any program can be added to this file.freebsd