FreeBSD Xorg & profile Configuration


Here's a copy of my Xorg and fvwm2 window manager configuration for my Acer Aspire One P531h.

For /etc/X11/xorg.conf the only netbook specific bit is adding an option...
Section "ServerLayout"
  ...
  ...
Option "AllowEmptyInput" "0"
  ...
  ...
EndSection

Note that a Modeline in /etc/X11/xorg.conf is not necessary for 1024x600 video operation when using the netbook display and the intel Xorg video driver. However, a Modeline is necessary for 1152x864 with my combination of netbook and full size monitor (Dell 21" Trinitron). I have, for some reason, always preferred 1152x864 resolution versus 1024x768 or 1280x1024.

At the moment, I simply edit xorg.conf and comment out or uncomment the proper Modes statement depending on the display in use. I should enable the Ctrl+Alt+KeyPadPlus and Ctrl+Alt+KeyPadMinus video mode switch capability, but so far it eludes me somewhere in the configuration.

Again, this is in /etc/X11/xorg.conf...
Section "Screen"
    Identifier  "Screen 1"
    Device      "videocard"
    Monitor     "My Monitor"
    DefaultDepth 24

    Subsection "Display"
        Depth       8
        Modes       "1280x1024" "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "1280x1024" "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        #
        # for netbook display
        #Modes       "1024x600"
        #
        # with full size monitor 1152x864
        Modes       "1152x864" "1280x1024" "1024x768" "800x600" "640x480"
        #
        ViewPort    0 0
    EndSubsection
EndSection

A copy of my /usr/local/etc/system.fvwm2rc - of course, you'll have to edit this to taste.
To move around in the grid of 7x14 virtual desktops, use Ctrl+ArrowKey. Also, on the root window (desktop background), the following keys start...

Alt+N - Firefox
Alt+O - OpenOffice
Alt+T - xterm
Alt+S - xterm, small
Alt+R - xterm, root login (SSH keys must be properly setup)

Right-click and center-click on the root window (desktop background) offer two different drop-down menus.

Also, Ctrl+Alt+ArrowKey moves the mouse pointer - convenient because I've enabled MouseOver window focus.

There are other keys assigned that run the scripts below. Check the KEYBOARD Setup in the system.fvwm2rc file, starting at around line 560 of the configuration file.

I put my custom scripts for starting various Xorg programs in /usr/local/scripts, and have added to the PATH.
Also, a number of these scripts expect the XFONT environment variable to be set. I use the 7x13bold font for text.

I use ksh, so in /etc/profile, I set the PATH and XFONT variables appropriately. That is, adding /usr/local/scripts to the PATH and setting XFONT to 7x13bold. I also setup a pretty prompt of the form username@hostname:/path/to/current/directory:exitcode$ and enabled vi command-line mode and a large command recall buffer.

The exitcode in the prompt is the exit value of the last command.

For the global /etc/profile PATH to take effect, I edited /usr/share/skel/dot.shrc to not set the PATH, prompt (variable PS1), enable emacs command-line mode, or setup personal command-line aliases.

Here's copies of my Xorg related scripts that I put in /usr/local/scripts -- these scripts are referenced in system.fvwm2rc under the keyboard setup section, as mentioned above.

Xorg startup related scripts in /usr/local/scripts...

xwallpaper - load desktop wallpaper
xwmmixer - wmmixer
xxclock - xclock
xconsole - xconsole
xload - xload
xautolock - Xorg startup - xautolock (screen saver)

Xorg hot-key related scripts in /usr/local/scripts...

xfirefox - firefox (Alt+N)
xnexit - nedit (Alt+E)
xcalc - xcalc (Alt+C)
xchat - xchat (Alt+Z)
xlockmore - xlockmore (Ctrl+Alt+Shift+L) - locks the X display
xxterm - xterm, small (Alt+S)
xxterm.big - xterm, big (Alt+T)

Finally, the /usr/local/lib/X11/xinit/xinitrc file, which launches the startup scripts shown above and the window manager (fvwm2) itself. The standard /usr/local/bin/startx script - for users to start Xorg - should work fine.

You can find all the above sample files in a tarball here -- unixninja-Xorg-scripts.tar.gz
MD5 (unixninja-Xorg-scripts.tar.gz) = 53cf95d9478a5956339487c708beb603
SHA256 (unixninja-Xorg-scripts.tar.gz) = 779d355f4bc3d7f1c0392c4cbe5c543b7a88bf24a7f21af80409d3edf5684c8c


Update: July 20, 2010

I purchased some 24.6" Samsung LCD Monitors/TVs. Details ... http://www.samsung.com/us/consumer/office/monitors/premium/LS25EMNKUY/ZA/index.idx?pagetype=prd_detail

With the Acer Aspire One running 1920x1080 resolution was not a problem for either WinXP or Xorg.

WinXP picked up the monitor capabilities right away with no driver update/install.

Xorg simply had to be told to use 1920x1080 as a resolution and it was all good.

/etc/X11/xorg.conf changed only slightly...
Section "Screen"
    Identifier  "Screen 1"
    Device      "videocard"
    Monitor     "My Monitor"
    DefaultDepth 24

    Subsection "Display"
        Depth       8
        Modes       "1280x1024" "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "1280x1024" "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        #
        # for netbook display
        #Modes       "1024x600"
        #
        # with full size monitor 1152x864
        #Modes       "1152x864" "1280x1024" "1024x768" "800x600" "640x480"
	#
	# with 24.6" LCD at 1920x1080
        Modes       "1920x1080"
        #
        ViewPort    0 0
    EndSubsection
EndSection

I also, just for comfort, adjusted the default size of my xxterm.big script from -geometry 120x45+25+25 to -geometry 180x60+175+75

Return to tips+howtos.