pavement

Desktop, light setup

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(XDM: customization)
(See also)
 
(129 intermediate revisions by one user not shown)
Line 1: Line 1:
After installing and configuring the base system, here are instructions on how to get a light desktop up and running quickly. The instructions provided show how to get xdm, slim or wdm login managers working. [[KDM]] and [[GDM]] login manager installations are not covered here, because they are part of base windowmanagers with heavy dependencies. This example on the window manager JWM should provide insight on how to install other window managers.
+
After installing and configuring the base system, here are instructions on how to get a light desktop up and running quickly. {{yhl|Xinit}} and {{yhl|XDM}} login managers are covered. Configuration of KDM, GDM, WDM and SLiM login managers is not described here, because they are part of windowmanagers that are not BSD style or are outdated.
  
 
==Install==
 
==Install==
 
The following input is sufficient to install the programs for a running Desktop system:
 
The following input is sufficient to install the programs for a running Desktop system:
  % pkg install xorg jwm slim
+
  % pkg install xorg jwm xdm
Alternatively, ports may be installed. xdm and wdm login managers are other options.
+
In this example, replace jwm with your chosen window manager. If you're not using a graphical desktop login manager, remove xdm from above.
  
==Login manager set up==
+
==Desktop login==
Basic session managers are XDM, WDM, and slim. After the login manager is configured, the Desktop must be set up, or the screen will go into a loop, back to the login manager after logging in.
+
Configuration files for XDM and Xinit are under the {{file|/usr/local/etc/X11/}} and {{file|~/}} directories, respective to Xsession and Xinit. The minimal configuration for {{file|.xsession}} or {{file|.xinit}} in your home directory is:
 +
#!/bin/sh
 +
exec ''/usr/local/bin/<windowmanager>''
  
===Slim===
+
===Console===
Slim is a practical choice for a login manager, unless you need remote login access. To enable slim, add to ''/etc/rc.conf'':
+
Set {{file|[[.xinitrc]]}} in each home folder, to load custom settings from that user's command line. The default {{file|/usr/local/etc/xinit/xinitrc}} points to several other files in your home directory.
slim_enable="YES"
+
  
Slim requires a ''*.desktop'' file in a directory that is specified by ''/usr/local/etc/slim.conf'' next to the '''sessiondir''' option; typically this would be ''/usr/local/share/xsessions''. Older versions of slim could have their window manager configured in the file ''slim.conf'' by the '''sessions''' option.  
+
Make sure the owner file permissions of {{file|[[.xinitrc]]}} are at minimum set to read.
 +
% chmod 440 .xinitrc
  
The ''usr/local/share/xsessions/*.desktop'' file commands must be in xdg-style, shown here http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html#basic-format.
+
Finally, type {{cmd|startx}}.
  
First create the desktop directory, if it doesn't exist, by typing:
+
===XDM===
  % mkdir -p /usr/local/share/xsessions/
+
To configure {{port|x11/xdm}} to start up on boot, edit {{file|/etc/ttys}} and change the option on line {{code|ttyv8}} from {{code|off}} to {{code|on}}:
 +
  ttyv8  "/usr/local/bin/xdm -nodaemon"  xterm  '''on''' secure
 +
The {{code|secure}} option allows logging in to the root console without a password from single user mode.
  
Example of ''/usr/local/share/xsessions/jwm.desktop'' file:
+
Set up {{file|.xsession}} with owner and group permissions to read and execute. If you soft link {{file|.xsession}} and {{file|.xinitrc}} together, both permissions must be 550.
Name=JWM
+
Exec=jwm
+
  
====Customization====
+
ln -s .xsession .xinitrc
To change the background, look into ''/usr/local/share/slim/themes/default/'', create a backup file of ''background.jpg'', then copy your choice background image to ''/usr/local/share/slim/themes/default/''
+
chmod 550 .xsession
  
% cd /usr/local/share/slim/themes/default
+
Under normal circumstances, {{file|/usr/local/etc/X11/xdm/Xsession}} should be left alone, because this file by default points to {{file|~/.xsession}} and {{file|~/.xsession-errors}}.
% mv background.jpg background.bk.jpg
+
% mv [pathname/your file] background.jpg
+
  
To create multiple themes, you may create a new directory under ''themes/'' that is similar to the ''default/'' directory, then specify this themes subdirectory from ''/usr/local/etc/slim.conf''. If you do this, be sure you start off with the three files: ''slim.theme'' , ''background.jpg'' and ''panel.png''.
+
====Customization====
 +
Customization files for XDM are located in {{file|/usr/local/etc/X11/xdm/}}.
  
Add or edit your themes to ''slim.conf'' :
+
The background image or color can be changed with a command argument in {{file|Xsetup_0}}. {{cmd|xsetroot}} can set the background to a color or bitmap image. To choose a common image type, use a program such as {{port|x11/bgs}} or {{port|graphics/feh}} from within {{file|Xsetup_0}}.
#current theme, use comma separated list to specify a set to randomly choose from
+
current_theme      default,mytheme
+
  
To create themes directories:
+
Example of {{file|Xsetup_0}}:
  % cd /usr/local/share/slim/themes
+
  #!/bin/sh
  % cp -R default mytheme
+
bgs /home/mydirectory/mypicture.png &
 +
  #xconsole &
 +
The {{code|xconsole}} line can optionally be commented out. {{port|x11/xconsole}} is useful for displaying terminal output.
  
Then edit the theme/ files to your liking. For more details of slim configuration, type either:
+
It is important to add an {{code|&}} after adding new configuration commands, or the login screen will freeze up with certain commands.
% man slim
+
% less /usr/local/etc/slim.conf.sample
+
  
===Command line===
+
To change the box logo, edit {{file|Xresources}}, comment out or reference another .xpm file in the lines {{code|xlogin*logoFileName}}.
First, set up an ''[[.xinitrc]]'' file in the home folder, which overrides ''/usr/local/etc/X11/xinit/xinitrc''.
+
  
Without ''.xinitrc'' the window manager will fail to load from ''startx''. Be sure to add '''exec [window manager]''' to the .xinitrc file, without an '''&'''. Here is an example:
+
==Desktop programs==
exec jwm
+
Read the documentation of your chosen window manager's configuration files to load programs, if it is available. If your window manager doesn't have the ability to load desktop programs, use {{file|.xsession}} or {{file|.xinitrc}}, to start them.
  
It is just like the ''.xsession'' file, except it doesn't have to be made executable. Optionally, a symbolic link can be created between the two files.
+
Example of {{file|.xsession}} or {{file|.xinitrc}}:
 
+
  #!/bin/sh
Once it is set up, type:
+
  xterm &
  % startx
+
xclock &
 
+
===XDM===
+
To configure xdm to start up on boot, edit ''/etc/ttys'' and change the option on line ttyv8 from '''off''' to '''on''':
+
ttyv8  "/usr/local/bin/xdm -nodaemon" xterm   '''on''' secure
+
Read about the '''secure''' setting in this file.
+
 
+
Then set up an ''[[.xsession]]'' file in the home folder, with the contents "'''exec [window manager]'''". Without ''.xsession'', the window manager will fail to load.
+
 
  exec jwm
 
  exec jwm
 +
Programs are loaded with {{code|&}}, and the window manager is loaded last with {{code|exec}}.
  
Be sure this file is made executable.
+
==Xorg==
 +
Xorg is now mostly auto-configured. {{file|xorg.conf}} is no longer used, but it is replaced by the directory {{file|/usr/local/etc/X11/xorg.conf.d/}} for specific configurations only. The syntax of a configuration filename in this directory is <customname>.conf, such as {{file|''10-nvidia.conf''}}.
  
  % chmod ug+x .xsession
+
See [[Configuring X]] and the [http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11.html FreeBSD Handbook: The X Window System] for more information.
  
''.xsession'' is identical to the file ''.xinitrc'' so a symbolic link may optionally be created. If this is done, make sure that ''.xinitrc'' is also made executable. In the next example, ''.xsession'' is the link, and ''.xinitrc'' is the regular file:
+
===Enabling hardware===
% ln -s .xinitrc .xsession
+
To enable the mouse and keyboard, considering that recent versions of xorg are set to use autodetection by default.
% chmod ug+x .xinitrc
+
  
If problems occur, check the file ''/var/log/xdm.log''
+
Add the following to {{file|/etc/rc.conf}}:
  % less /var/log/xdm.log
+
  dbus_enable="YES"
  
====Customization====
+
For using devfs, add to {{file|/etc/fstab}}:
Customization files for XDM are located at ''/usr/local/lib/X11/xdm''. See http://www.tldp.org/HOWTO/XFree-Local-multi-user-HOWTO/automation_login_screen.html for customizing the background image: note the base directories are different.
+
devfs      /dev      devfs    rw  0 0 # not necessary unless custom configuration is needed
 +
fdescfs    /dev/fd    fdescfs  rw  0 0
  
===WDM===
+
{{man|fdescfs|5}} can alternatively be loaded through compiling in the kernel or through {{file|/boot/loader.conf}}. {{port|x11-servers/xorg-server}} has to be built without the hal option for this configuration.
Here is how to set up Wings Display Manager's (WDM).
+
 
+
To enable WDM, edit line '''ttyv8''' in file ''/etc/ttys'' to:
+
ttyv8  "/usr/local/bin/'''wdm''' -nodaemon"  xterm  '''on''' secure
+
 
+
It's configuration files are at ''/usr/local/lib/X11/wdm/''.
+
 
+
Make sure the file ''/usr/local/lib/X11/wdm/wdm-config'' lists your window manager on the line '''DisplayManager*wdmWm:'''. The default window manager for WDM is windowmaker:
+
DisplayManager*wdmWm:          wmaker:afterstep:blackbox:ctwm:enlightenment:fvwm:fvwm2:fvwm95:olvwm:qvwm:tvtwm:jwm
+
 
+
After rebooting, click the option on WDM's login screen, before logging in.
+
 
+
==Desktop programs==
+
Some desktop programs should be started through the window manager's configuration files, and others can be started through .xinitrc or .xsession.
+
 
+
For ''.xinit'' and ''.xsession'' only add a space and ampersand '''&''' after programs that are meant to run and detach.
+
 
+
==Enabling keyboard and mouse==
+
To enable the mouse and keyboard add the following to ''/etc/rc.conf'':
+
hald_enable="YES"
+
dbus_enable="YES"
+
  
Enabling these options sooner may make it harder to fix problems.
+
See the manpages: {{man|devd}}, {{man|devfs}}, {{man|devfs.conf}} and {{man|devfs.rules}}. For advanced topics on hardware configuration, such as information about videocards, enabling HDMI audio out, and using multiple displays, see [[Hardware Configuration, Audio/Video]].
  
Older versions of FreeBSD required the line in the Xorg configuration file to be manually set to:
+
==See also==
Option "AllowEmptyInput" "False"
+
* [[Hardware Configuration, Audio/Video]] - for setting up: ATI, Intel or Nvidia graphics cards; multiple monitors; audio; and overscan
 +
* [[Desktop, troubleshooting]]
 +
* [[Window Managers, BSD]]
  
 
== References==
 
== References==
 
* FreeBSD 6 Unleashed (2006)
 
* FreeBSD 6 Unleashed (2006)
* Various FreeBSD and other related forums
+
* FreeBSD related documentation and forums
* FreeBSD documentation
+
  
 
[[Category:FreeBSD for Workstations]]
 
[[Category:FreeBSD for Workstations]]
 
[[Category:FreeBSD Multimedia]]
 
[[Category:FreeBSD Multimedia]]
[[Category:Installation]]
+
[[Category:Configuring FreeBSD]]
 +
[[Category:New_User_Tips_and_FAQs]]

Latest revision as of 16:30, 11 February 2018

After installing and configuring the base system, here are instructions on how to get a light desktop up and running quickly. Xinit and XDM login managers are covered. Configuration of KDM, GDM, WDM and SLiM login managers is not described here, because they are part of windowmanagers that are not BSD style or are outdated.

Contents

[edit] Install

The following input is sufficient to install the programs for a running Desktop system:

% pkg install xorg jwm xdm

In this example, replace jwm with your chosen window manager. If you're not using a graphical desktop login manager, remove xdm from above.

[edit] Desktop login

Configuration files for XDM and Xinit are under the /usr/local/etc/X11/ and ~/ directories, respective to Xsession and Xinit. The minimal configuration for .xsession or .xinit in your home directory is:

#!/bin/sh
exec /usr/local/bin/<windowmanager>

[edit] Console

Set .xinitrc in each home folder, to load custom settings from that user's command line. The default /usr/local/etc/xinit/xinitrc points to several other files in your home directory.

Make sure the owner file permissions of .xinitrc are at minimum set to read.

% chmod 440 .xinitrc

Finally, type startx.

[edit] XDM

To configure x11/xdm to start up on boot, edit /etc/ttys and change the option on line ttyv8 from off to on:

ttyv8   "/usr/local/bin/xdm -nodaemon"  xterm   on secure

The secure option allows logging in to the root console without a password from single user mode.

Set up .xsession with owner and group permissions to read and execute. If you soft link .xsession and .xinitrc together, both permissions must be 550.

ln -s .xsession .xinitrc
chmod 550 .xsession

Under normal circumstances, /usr/local/etc/X11/xdm/Xsession should be left alone, because this file by default points to ~/.xsession and ~/.xsession-errors.

[edit] Customization

Customization files for XDM are located in /usr/local/etc/X11/xdm/.

The background image or color can be changed with a command argument in Xsetup_0. xsetroot can set the background to a color or bitmap image. To choose a common image type, use a program such as x11/bgs or graphics/feh from within Xsetup_0.

Example of Xsetup_0:

#!/bin/sh
bgs /home/mydirectory/mypicture.png &
#xconsole & 

The xconsole line can optionally be commented out. x11/xconsole is useful for displaying terminal output.

It is important to add an & after adding new configuration commands, or the login screen will freeze up with certain commands.

To change the box logo, edit Xresources, comment out or reference another .xpm file in the lines xlogin*logoFileName.

[edit] Desktop programs

Read the documentation of your chosen window manager's configuration files to load programs, if it is available. If your window manager doesn't have the ability to load desktop programs, use .xsession or .xinitrc, to start them.

Example of .xsession or .xinitrc:

#!/bin/sh
xterm &
xclock &
exec jwm

Programs are loaded with &, and the window manager is loaded last with exec.

[edit] Xorg

Xorg is now mostly auto-configured. xorg.conf is no longer used, but it is replaced by the directory /usr/local/etc/X11/xorg.conf.d/ for specific configurations only. The syntax of a configuration filename in this directory is <customname>.conf, such as 10-nvidia.conf.

See Configuring X and the FreeBSD Handbook: The X Window System for more information.

[edit] Enabling hardware

To enable the mouse and keyboard, considering that recent versions of xorg are set to use autodetection by default.

Add the following to /etc/rc.conf:

dbus_enable="YES"

For using devfs, add to /etc/fstab:

devfs      /dev       devfs     rw   0 0 # not necessary unless custom configuration is needed
fdescfs    /dev/fd    fdescfs   rw   0 0

fdescfs(5) can alternatively be loaded through compiling in the kernel or through /boot/loader.conf. x11-servers/xorg-server has to be built without the hal option for this configuration.

See the manpages: devd(), devfs(), devfs.conf() and devfs.rules(). For advanced topics on hardware configuration, such as information about videocards, enabling HDMI audio out, and using multiple displays, see Hardware Configuration, Audio/Video.

[edit] See also

[edit] References

  • FreeBSD 6 Unleashed (2006)
  • FreeBSD related documentation and forums
Personal tools