pavement

Desktop, light setup

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(Rescue configuration)
(See also)
 
(34 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.  
+
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 xdm fluxbox
+
  % pkg install xorg jwm xdm
This example on the window manager fluxbox provides insight on how to install other window managers.
+
In this example, replace jwm with your chosen window manager. If you're not using a graphical desktop login manager, remove xdm from above.
  
 
==Desktop login==
 
==Desktop login==
The instructions provided show how to get {{yhl|XDM}} or {{yhl|SLiM}} login managers working. KDM, GDM, and WDM login manager installations are not covered here, because they are part of base windowmanagers that are not BSD style.
+
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:
 
+
To proceed with your choice of desktop login...
+
 
+
===XDM===
+
To configure {{port|x11/xdm}} to start up on boot, edit {{file|/etc/ttys}} and change the option on line 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.
+
 
+
Then set up {{file|.xsession}} in each home folder, with owner permissions to read and execute, for example {{code|chmod 400 .xsession}}.
+
 
+
{{file|.xsession}} requires the minimum of:
+
 
  #!/bin/sh
 
  #!/bin/sh
 
  exec ''/usr/local/bin/<windowmanager>''
 
  exec ''/usr/local/bin/<windowmanager>''
exec $1
 
 
If problems occur, check {{file|/var/log/xdm.log}}
 
% less /var/log/xdm.log
 
 
====Customization====
 
Customization files for XDM are located in {{file|/usr/local/lib/X11/xdm/}}.
 
 
The background image can be changed by using a background setting command in {{file|Xsetup_0}}. {{cmd|xsetroot}} can change the background color, but for images it is limited in the file types it can display. To overcome this, use {{port|graphics/feh}}.
 
 
Example of addition to {{file|Xsetup_0}}:
 
feh --bg-scale /home/user1/bsd.jpg &
 
It is important to add an {{code|&}} after adding new configuration commands, or the login screen will freeze up with certain commands.
 
 
To change the box logo, edit {{file|Xresources}}, comment out or reference another .xpm file in the lines {{code|xlogin*logoFileName}}.
 
 
The file {{file|Xsession}} is responsible for choosing the window manager, it points to {{file|.xsession}} in the home directory.
 
 
For more information, see [http://www.tldp.org/HOWTO/XFree-Local-multi-user-HOWTO/automation_login_screen.html XFree Local Multi-User HOWTO: Using xdm] and [https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-xdm.html FreeBSD Handbook: XDM Configuration Files].
 
  
 
===Console===
 
===Console===
Without a properly set {{file|[[.xinitrc]]}} in each home folder, the window manager will fail to load from that user's command line. Add {{code|exec <window manager>}} to the {{file|.xinitrc}} file, without an {{code|&}}. Here is an example of the minimum needed {{file|.xinitrc}}:
+
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.
#!/bin/sh
+
exec ''/usr/local/bin/fluxbox''
+
exec $1
+
  
 
Make sure the owner file permissions of {{file|[[.xinitrc]]}} are at minimum set to read.
 
Make sure the owner file permissions of {{file|[[.xinitrc]]}} are at minimum set to read.
  % chmod 400 .xinitrc
+
  % chmod 440 .xinitrc
  
 
Finally, type {{cmd|startx}}.
 
Finally, type {{cmd|startx}}.
  
===Slim===
+
===XDM===
{{port|x11/slim}} is a practical choice for a login manager, unless remote login access is needed. To enable slim, edit the line in {{file|/etc/ttys}} to :
+
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/'''slim''' -nodaemon"           xterm  '''on''' secure
+
  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.
 +
 
 +
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.
  
Slim requires a {{file|*.desktop}} file, typically in {{file|/usr/local/share/xsessions/}}. This directory is specified in {{file|/usr/local/etc/slim.conf}} next to the {{code|sessiondir}} option. If the directory doesn't exist, create it with the {{cmd|mkdir -p}} command.
+
ln -s .xsession .xinitrc
 +
chmod 550 .xsession
  
Example of a minimal {{file|/usr/local/share/xsessions/fluxbox.desktop}} file:
+
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}}.
[Desktop Entry]
+
Name=FLUXBOX
+
Exec=fluxbox
+
{{file|.desktop}} files are in xdg-style, demonstrated at [http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html#basic-format Desktop Entry Specification].  
+
  
 
====Customization====
 
====Customization====
To change the background, look into {{file|/usr/local/share/slim/themes/default/}} [optionally create a backup file of {{file|background.jpg}}] then copy your choice background image to {{file|/usr/local/share/slim/themes/default/background.jpg}}
+
Customization files for XDM are located in {{file|/usr/local/etc/X11/xdm/}}.
  
% cd /usr/local/share/slim/themes/default
+
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}}.
% mv background.jpg background.bk.jpg
+
% cp [pathname/your file] background.jpg
+
  
To create multiple themes, you may create a new directory under {{file|themes/}} that is similar to the {{file|default/}} directory, then specify this themes subdirectory from {{file|/usr/local/etc/slim.conf}}. If you do this, be sure each used folder ends off with three files named: {{file|slim.theme}}, {{file|background.jpg}} and {{file|panel.png}}.
+
Example of {{file|Xsetup_0}}:
 +
#!/bin/sh
 +
bgs /home/mydirectory/mypicture.png &
 +
#xconsole &
 +
The {{code|xconsole}} line can optionally be commented out. {{port|x11/xconsole}} is useful for displaying terminal output.
  
Add or edit your themes to {{file|slim.conf}}:
+
It is important to add an {{code|&}} after adding new configuration commands, or the login screen will freeze up with certain commands.
#current theme, use comma separated list to specify a set to randomly choose from
+
current_theme      default,mytheme
+
  
To create themes directories:
+
To change the box logo, edit {{file|Xresources}}, comment out or reference another .xpm file in the lines {{code|xlogin*logoFileName}}.
% cd /usr/local/share/slim/themes
+
% cp -R default mytheme
+
 
+
Then edit the {{file|mytheme/}} files to your liking. For more details of slim configuration, type either:
+
% man slim
+
 
+
% less /usr/local/etc/slim.conf.sample
+
  
 
==Desktop programs==
 
==Desktop programs==
Use the window manager's configuration files, {{file|.xsession}} or {{file|.xinitrc}}, depending on which one is used, to start up desktop programs. The window manager's configuration files, and {{file|.xsession}} can be used in combination to start programs, but, for clarity, it is better to not redundantly start the window manager through both.
+
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.
  
 
Example of {{file|.xsession}} or {{file|.xinitrc}}:
 
Example of {{file|.xsession}} or {{file|.xinitrc}}:
Line 93: Line 53:
 
  xterm &
 
  xterm &
 
  xclock &
 
  xclock &
  exec fluxbox
+
  exec jwm
exec $1
+
Programs are loaded with {{code|&}}, and the window manager is loaded last with {{code|exec}}.
Programs are loaded with {{code|&}}, and the window manager is loaded last with {{code|exec}}. The first and last line ensure which shell to use and to exit the script cleanly. The user's permissions will have to be set to read and execute, for example {{code|chmod 500 .xinitrc .xsession}}. {{file|.xsession}} and {{file|.xinit}} can be soft-linked to each other, which will make their file permissions match.
+
  
 
==Xorg==
 
==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''}}.
+
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''}}.
  
 
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.
 
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.
Line 109: Line 68:
  
 
For using devfs, add to {{file|/etc/fstab}}:
 
For using devfs, add to {{file|/etc/fstab}}:
  devfs      /dev      devfs    rw   0   0 # May not be necessary, since devfs automatically uses /dev
+
  devfs      /dev      devfs    rw   0 0 # not necessary unless custom configuration is needed
  fdescfs    /dev/fd    fdescfs  rw   0   0 # May not be necessary, since devfs automatically loads it
+
  fdescfs    /dev/fd    fdescfs  rw  0 0
 
+
Programs may have to be built without the hal option. See the manpages: {{man|devd}}, {{man|devfs}}, {{man|devfs.conf}}, {{man|devfs.rules}}, and {{man|fdescfs}}.
+
 
+
For more advanced topics on hardware configuration, see [[Hardware Configuration, Audio/Video]].
+
 
+
===Obsolete configuration reference===
+
This is for those who are familiar with older versions of FreeBSD.
+
 
+
Manually setting the option in {{file|xorg.conf}} to the next line enabled the mouse and keyboard:
+
Option "AllowEmptyInput" "False"
+
 
+
{{file|/etc/rc.conf}}:
+
 
+
hald_enable="YES" #this option can be replaced with FreeBSD's native program devd, if set in xorg-server.
+
 
+
For a custom xorg configuration file:
+
% Xorg -configure
+
After testing this configuration, {{file|xorg.conf.new}} can be copied to {{file|/etc/X11/xorg.conf}}:
+
% cp /root/xorg.conf.new /etc/X11/xorg.conf
+
 
+
==Rescue configuration==
+
If an error is made, there are convenient options to fix the problem from the console, without requiring the install disc. The availability of some options depend on the situation.
+
  
One solution is to reboot into single user mode, then remount the drive using {{cmd|mount -u /}}. Other partitions required for start-up may have to manually be mounted. To make it easier, you can use the mountpoints in {{file|/etc/fstab}}.
+
{{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.
  
SLiM will let you log in to the console line, by entering "{{code|console}}", depending on it's configuration file, as the login user name and the root password.
+
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]].
  
{{yhl|<ctrl><alt><f-key>}} will pull up a virtual console, where you can log in to fix configuration errors. This uses either the {{man|sc|4}} or {{man|vt|4}} driver. The sc driver doesn't work with all video cards.
+
==See also==
 +
* [[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: https://forums.freebsd.org/
+
* FreeBSD related documentation and forums
* FreeBSD and programs 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