# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Die Sep 04 01:44:19 CEST 2007 [mika]
################################################################################
-# make sure /tmp is writeable {{{
- if ! [ -w /tmp ] ; then
- echo 'Fatal: /tmp is not writeable. Can not resume therefore, sorry.' >&2
- exit 1
- fi
-# }}}
-
# debugging {{{
# usage: DEBUG=1 grml-x ..... 2>/tmp/grml-x-debug.log
if [[ $DEBUG -gt 0 ]]; then
[ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
# temporary files
- HWINFO_TMP="/tmp/hwinfo.$$"
- MONITORINFO="/tmp/monitorinfo.$$"
- MOUSEINFO="/tmp/mouse.$$"
+ # notice: we need the unsafe option, otherwise users other than root
+ # can not write to HWINFO_TMP, but we don't want to run hwinfo as root
+ HWINFO_TMP="$(mktemp -u)" || exit 1
+ MONITORINFO="$(mktemp)" || exit 1
+ MOUSEINFO="$(mktemp)" || exit 1
+
+ if [ -z "$HWINFO_TMP" ] ; then
+ echo "Fatal: could not create temporary file. Exiting.">&2
+ bailout 1
+ fi
if [ -r /etc/sysconfig/keyboard ] ; then
source /etc/sysconfig/keyboard
$PROGRAMNAME [-options] windowmanager
Usage examples:
- $PROGRAMNAME wmii
$PROGRAMNAME fluxbox
- $PROGRAMNAME openbox
+ $PROGRAMNAME fluxbox
$PROGRAMNAME -force -nostart fluxbox
$PROGRAMNAME -nosynaptics fluxbox
$PROGRAMNAME -nosync fluxbox
- $PROGRAMNAME -noddc wmii
- $PROGRAMNAME -xinerama -composite wmii
- $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 openbox
- XINITRC=~/.xinitrc $PROGRAMNAME openbox
- $PROGRAMNAME -display 8 openbox
+ $PROGRAMNAME -noddc fluxbox
+ $PROGRAMNAME -xinerama -composite fluxbox
+ $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 fluxbox
+ XINITRC=~/.xinitrc $PROGRAMNAME fluxbox
+ $PROGRAMNAME -display 8 fluxbox
More information on grml-x can be found in the manual page: man grml-x
if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
MOUSEDRIVER='synaptics'
- SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
+ SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
SYNMOUSEDETAIL="
Section \"InputDevice\"
Driver \"synaptics\"
if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
MOUSEDRIVER='synaptics'
- SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
+ SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
SYNMOUSEDETAIL="
Section \"InputDevice\"
Driver \"synaptics\"
# /usr/share/doc/xserver-xorg/ and
# http://wiki.x.org/wiki/Home and
# http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
-#
+#
# Refer to the xorg.conf man page and to
# http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
# for details about the format of this file.
Screen 0 "Screen0" 0 0
# InputDevice "Keyboard0" "CoreKeyboard"
# InputDevice "Generic Mouse" "CorePointer"
+ Option "AutoAddDevices" "off" # do not depend on running dbus/hal
$MOUSE
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
Option "DontVTSwitch" "false" # allow switching between virtual terminal
- # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
+ Option "DontZap" "false" # enable <Crtl><Alt><BS> (server abort)
# Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
EndSection
Load "extmod" # some commonly used server extensions (e.g. shape extension)
Load "record" # recording extension
Load "evdev" # generic input handling driver on Linux
+ Load "xtrap" # X Trap extension
# Load "vbe" # Vesa BIOS Extension
# Load "i2c" # I2C bus
# Load "int10" # initialize graphics cards via int10 call to the BIOS
# writeit {{{
writeit() {
- XCONFTMP="/tmp/xconfig.$$"
+ XCONFTMP="$(mktemp)"
xconfig > $XCONFTMP
# we do not want to have two CorePointers, deactivate one therefore
if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
function runit
{
writeconfig
+ if [ "$(readlink /etc/X11/X)" = /bin/true ] ; then
+ print "$bold_color$fg[red]Fatal: /etc/X11/X is a symlink to /bin/true."
+ print "Fix it via running 'ln -sf /usr/bin/Xorg /etc/X11/X'"
+ exit 10
+ fi
if [ -z "$NOSTART" ] ; then
print "$reset_color"
if [ -x /etc/init.d/xorg-common ] ; then
if [ -z "$DISPLAY" ] ; then
print "$bold_color$fg[green]Now trying to run startx.$reset_color"
startx $XINITRC -- $XOPTS
+ return 1
else
print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
startx $XINITRC -- :$DISPLAY $XOPTS
+ return 1
fi
else
print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
fi
- return 1
}
# }}}