View Single Post
Old 12th July 2012
barti barti is offline
Shell Scout
 
Join Date: Jul 2012
Posts: 122
Default still not clear what to do.

http://www.openbsd.org/faq/faq11.html#amd64i386
-------------------

An example of how a tutorial is not useful.
What file should I configure and how to remove X for starting automatically?


------------------------------
I never got things running from tutorials on openbsd.






sable the console getty(8) to use xdm(1).

11.5 - Customizing X
11.5.1 - Introduction
OpenBSD's default X environment is fully functional, but you may wish to customize it. You may wish to change the background pattern or color, or you may wish to change the Window Manager (the program that most defines your X environment), or change the applications that are started when X starts.

The default window manager in OpenBSD is fvwm(1). Fvwm is a good, general purpose window manager, but it is hardly your only choice; it isn't even the only window manager included with OpenBSD (see cwm(1) and twm(1)). A large number of window managers are also available through packages.

Similar to the system startup script, X has a process it goes through to set up the user environment. More accurately, it has more than one process; which process is used depends on how you start X. Understanding how X starts will help you understand how to customize your work environment the way you wish it to be.

Note that you can customize the environment on both a system-wide and user level. It is probably best to do user level changes rather than to change the system defaults, as the user scripts are stored in the user's home directory, so you will have less merging of files to do when upgrading to a new version of OpenBSD. The system-wide defaults are in /etc/X11 and were initially loaded from xetcXX.tgz, which is not reloaded by the suggested upgrade process, so if you make system-wide changes, they will persist, but you may need to merge those changes into later versions of those files.
11.5.2 - startx(1) startup
startx(1) looks for the file .xinitrc in the user's home directory. .xinitrc is usually a shell script, which can start as many X "client" (applications that use X) programs as desired. When this script exits, the X server shuts down. Generally, most of the programs run by this script should run in the background, though the last one should run in the foreground (typically the window manager); when it exits, the script will exit, and X will be shutdown.

In the simplest case, this can be as little as just the name of the window manager you wish to invoke:

cwm

Or you can get a little more fancy:

xconsole -geometry -0+0 -fn 5x7 &
oclock -geometry 75x75-0-0 &
xsetroot -solid grey &
cwm

That will start the xconsole(1) which provides a copy of any text that the kernel would have sent to the console (which is now covered by the graphical screen), an analog clock, oclock(1), and sets the background to a solid grey background with xsetroot(1) all before invoking the cwm(1) window manager. Note that only the window manager is not "backgrounded" with an "&" character. This means that X will stay running until cwm(1) exits.

If a user's home directory does not have a .xinitrc file in it, the system's /etc/X11/xinit/xinitrc file is used. This file can provide you some additional ideas for your .xinitrc script.
11.5.3 - xdm(1) startup
xdm(1) is usually started by the system startup scripts, but for testing purposes (recommended, until you know your have your X config right!), it can be run as root.

xdm(1) has a lot of other functionality that won't be touched on here, but for our purposes, xdm will present the user with a login screen, get and verify a user name and password, and then give the user their X environment. When X shuts down, either deliberately or accidently, xdm will start it back up again. This is why you want to make sure X is configured properly before using xdm(1), and certainly before having xdm(1) start at boot, otherwise, you may have some difficulty getting control of the machine.

When xdm(1) starts, it runs the /etc/X11/xdm/Xsession, which will check to see if the user has a .xsession file in their home directory. So, if you wish to change your default window manager, simply invoke it (and maybe other things) in .xsession. Again, any programs you want started with X (for example, maybe three xterm(1)s) can be placed here, but all should be backgrounded except for your window manager, as again, when that exits, your X session will be ended. In this case, xdm(1) will restart X and bring you back to a login screen.
11.5.4 - Trying a new window manager
You can invoke a particular window manager when you load X without altering any defaults like this:

$ startx /usr/local/bin/fluxbox

Several window managers (including cwm(1) and fvwm(1)) offer the ability to change window managers on the fly, without restarting X or any of your applications. Your new window manager replaces your old one; exiting the newly-loaded window manager terminates X, it does not return you back to your previous window manager. fvwm(1) allows you to start a different window manager by left clicking on the background ("root window"), chose "(Re)Start", then pick your preferred window manager (however, note that you will need to add your alternative window managers to your .fvwmrc file (the system-wide default is /usr/X11R6/lib/X11/fvwm/.fvwmrc)). cwm(1) allows you to invoke another window manager by hitting Ctrl-Alt-w, and typing in the manager you wish to switch to.

Once you have found a window manager you like, you can set it as the final program run by your startup scripts as described above.

[FAQ Index] [To Section 10 - System Management] [To Section 12 - Hardware and Platform-Specific Questions]
Reply With Quote