Startx

From LQWiki
Jump to: navigation, search

startx is a script used to start an x server. It is actually a front end to xinit and tries to be a bit more user friendly. It usually doesn't require any arguments, just run startx and the x server should start up properly, and an X client application (usually your window manager) should be started. Which X client is started is read from the .xinitrc and/or .xserverrc files in the users home dir, and if these aren't available it will read the xinitrc/xserverrc from the X server config dir (usually /etc/X11). And if even these don't exists it will just fall back to running a plain xterm.

startx accepts the same options as the xinit command (these are just passed on to it) and also the options of the X server executable, these can be specified after a -- on the command line. Example usage to select a different X server layout setting:

# startx -- -layout TV-out

Startup Configuration

Startup programs, including window managers, can be configured via the .xinitrc file. However, if one is using a login manager (eg. xdm), then one will need to edit either .Xsession or .Xclients.

As one may see, this poses a bit of a portability problem. As a tip, make .Xsession and .Xclients symbolic links to .xinitrc. That way, whenever anybody edits .Xsession or .Xclients, one is merely editing .xinitrc (the syntax is the same in all three files.)

Yet another problem arises if one is using a manager such as enlightenment, or desktop environments like gnome or KDE, because they may ignore .xinitrc all together and use its own session-saving system.

Font Size Selection

The startx command has the following syntax for selecting a font DPI. In order for this to work, 100 DPI xfonts must be installed and referenced to in the X configuration file.

# startx -- -dpi 100

See Also

Configuring X