3 # Purpose: wrapper for startx on grml [providing new xconfiguration tool]
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
10 # usage: DEBUG=1 grml-x ..... 2>/tmp/grml-x-debug.log
11 if [[ $DEBUG -gt 0 ]]; then
16 # functions and color {{{
17 # use colors only if not booted with nocolor bootoption
18 if ! grep -q nocolor /proc/cmdline ; then
19 autoload colors ; colors
20 [ -r /etc/grml_colors ] && . /etc/grml_colors
23 # some functions like getBootParam
24 if [ -r /etc/grml/script-functions -a -r /etc/grml/sh-lib ] ; then
25 source /etc/grml/script-functions
26 source /etc/grml/sh-lib
28 echo 'Error: sourcing function files failed. Exiting.'
32 check4root &>/dev/null && ROOT='1' || ROOT=''
37 HWINFO='/usr/sbin/hwinfo'
39 [ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
42 # notice: we need the unsafe option, otherwise users other than root
43 # can not write to HWINFO_TMP, but we don't want to run hwinfo as root
44 HWINFO_TMP="$(mktemp -u)" || exit 1
45 MONITORINFO="$(mktemp)" || exit 1
46 MOUSEINFO="$(mktemp)" || exit 1
48 if [ -z "$HWINFO_TMP" ] ; then
49 echo "Fatal: could not create temporary file. Exiting.">&2
53 if [ -r /etc/sysconfig/keyboard ] ; then
54 source /etc/sysconfig/keyboard
60 XCONFIG='/etc/X11/xorg.conf'
61 KEYBOARD="# Driver \"kbd\"
62 # Option \"XkbRules\" \"xfree86\"
63 # Option \"XkbRules\" \"xorg\"
64 # Option \"XkbModel\" \"pc105\"
65 # Option \"XkbLayout\" \"${XKEYBOARD},us\"
66 # Option \"XkbVariant\" \"nodeadkeys\""
69 if [ -d /usr/share/fonts/X11 ] ; then
70 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
71 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
72 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
73 FontPath \"/usr/share/fonts/X11/Type1\"
74 FontPath \"/usr/share/fonts/X11/100dpi\"
75 FontPath \"/usr/share/fonts/X11/75dpi\""
77 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
78 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
80 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
82 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
83 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
84 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
85 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
86 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
87 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
88 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
92 # make sure we don't leave any temp files {{{
94 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
95 [ -n "$1" ] && EXIT="$1" || EXIT="1"
96 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
100 trap bailout 1 2 3 15
103 # warn if running as user root {{{
104 if [ -n "$ROOT" ] ; then
105 if [ -r /etc/grml_cd ] ; then
106 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
107 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
108 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
111 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
112 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
116 fstabuser=$(grep ':x:1000:' /etc/passwd)
117 fstabuser=${fstabuser%%[:]*}
120 # usage information {{{
123 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
124 print "$bg[black]$fg[red]$bold_color"
127 $PROGRAMNAME [-options] windowmanager
131 $PROGRAMNAME -force -nostart fluxbox
132 $PROGRAMNAME -nosynaptics fluxbox
133 $PROGRAMNAME -nosync fluxbox
134 $PROGRAMNAME -noddc fluxbox
135 $PROGRAMNAME -xinerama -composite fluxbox
136 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 fluxbox
137 XINITRC=~/.xinitrc $PROGRAMNAME fluxbox
138 $PROGRAMNAME -display 8 fluxbox
140 More information on grml-x can be found in the manual page: man grml-x
142 print "${reset_color}"
150 if [ -n "$ROOT" ] ; then
151 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
153 $HWINFO > $HWINFO_TMP
161 sudo $HWINFO --monitor > $MONITORINFO
168 [ -r "$MONITORINFO" ] || monitor # get monitor settings
169 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
170 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
172 if [ -n "$XINERAMA" ] ; then
176 Option for $fg[yellow]Xinerama$fg[green] found, please use xrandr inside X.org for your further configuration!
177 Trying to identify monitors now..."
179 # make sure we have information from 2 monitors:
180 # - first one from 'hwinfo --monitor' => $MONITORINFO
181 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
182 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
183 if [ -z "$FRAMEBUFFER" ] ; then
185 Fatal: could not identify two monitors - no chance to
186 set up multihead using Xinerama - sorry. :-(
188 Please run grml-x without the -xinerama option to start
189 X anyway (dropping support for Xinerama of course) and
190 contact grml developers if you have any further useful
191 information. => http://grml.org/bugs/
196 # check whether we can read the $MONITORINFO file
197 if ! [ -r "$MONITORINFO" ] ; then
199 Fatal: could not identify monitor - no chance to
200 set up multihead using Xinerama - sorry. :-(
204 # Currently we only know that it works with current intel driver,
205 # so inform user about that:
206 if [[ "$MODULE" != "intel" ]] ; then
209 Warning: using a non-intel driver - trying Xinerama setup anyway.
210 If it worked please contact grml developers providing information
211 about your setup so we can adjust grml-x according!
213 -> http://grml.org/contact/
215 Sleeping for 10 seconds now... Will continue then...
216 Just press Ctrl-C to cancel operation.
221 # now calculate Virtual size for use with Xinerama
222 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
223 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
224 # it might happen that we don't have a Max Resolution in hwinfo output :-/
225 # fall back to a generic value then...
226 # TODO: check out how to get resolution of external monitor from console
227 if [ -z "$HORIZ_RES1" ] ; then
232 # get maximum of output
233 HORIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*: \(.*\)x.*/\1/'| sort -u | head -1)"
234 VERIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*x\(.*\) (.*/\1/' | sort -u | head -1)"
236 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" -a -n "$VERIZ_RES2" ] ; then
237 if [ "$(echo $VERIZ_RES1" - "$VERIZ_RES2 | bc -l)" -eq 0 ] ; then
238 VERIZ_RESULT="$VERIZ_RES1"
239 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
240 VERIZ_RESULT="$VERIZ_RES1"
242 VERIZ_RESULT="$VERIZ_RES2"
245 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
247 # important: keep newline for appropriate placing below $MODES!
248 if [ -n "$HORIZ_RESULT" ] ; then
250 Virtual $HORIZ_RESULT $VERIZ_RES1"
256 if [[ -n $NODDC ]] ; then
257 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
258 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
259 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
261 MODES="# Modes $modes$VIRTUAL"
266 # sync - get hsync/vsync settings {{{
269 [ -r "$MONITORINFO" ] || monitor # get monitor settings
270 [ -r "$MONITORINFO" ] || bailout 1
271 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
272 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
273 if [ -z $vsyncval ] ; then
274 vsyncval='50.0 - 60.0'
276 if [ -z $hsyncval ] ; then
277 hsyncval='28.0 - 96.0'
285 sudo $HWINFO --mouse > $MOUSEINFO
287 # SynPS/2 Synaptics TouchPad
288 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
289 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
290 MOUSEDRIVER='synaptics'
291 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
293 Section \"InputDevice\"
295 Identifier \"Synaptics\"
296 Option \"Device\" \"/dev/psaux\"
297 Option \"Protocol\" \"auto-dev\"
298 Option \"LeftEdge\" \"1700\"
299 Option \"RightEdge\" \"5300\"
300 Option \"TopEdge\" \"1700\"
301 Option \"BottomEdge\" \"4200\"
302 Option \"FingerLow\" \"25\"
303 Option \"FingerHigh\" \"30\"
304 Option \"ZAxisMapping\" \"4 5\"
305 Option \"MaxTapTime\" \"180\"
306 Option \"MaxTapMove\" \"220\"
307 Option \"VertScrollDelta\" \"100\"
308 Option \"MinSpeed\" \"0.06\"
309 Option \"MaxSpeed\" \"0.12\"
310 Option \"AccelFactor\" \"0.0010\"
311 # Option \"SHMConfig\" \"on\"
312 # Option \"Repeater\" \"/dev/ps2mouse\"
318 SYNMOUSE='# No synaptics touchpad detected.'
322 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
323 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
324 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
325 MOUSEDRIVER='synaptics'
326 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
328 Section \"InputDevice\"
330 Identifier \"Synaptics\"
331 Option \"Device\" \"/dev/psaux\"
332 Option \"Protocol\" \"auto-dev\"
333 Option \"LeftEdge\" \"120\"
334 Option \"RightEdge\" \"850\"
335 Option \"TopEdge\" \"120\"
336 Option \"BottomEdge\" \"650\"
337 Option \"FingerLow\" \"14\"
338 Option \"FingerHigh\" \"15\"
339 Option \"ZAxisMapping\" \"4 5\"
340 Option \"MaxTapTime\" \"180\"
341 Option \"MaxTapMove\" \"50\"
342 Option \"MaxDoubleTapTime\" \"100\"
343 Option \"VertScrollDelta\" \"20\"
344 Option \"HorizScrollDelta\" \"20\"
345 Option \"MinSpeed\" \"0.3\"
346 Option \"MaxSpeed\" \"2.00\"
347 Option \"AccelFactor\" \"0.030\"
348 Option \"UpDownScrolling\" \"1\"
349 Option \"EmulateMiddleButtonTime\" \"75\"
350 Option \"CircularScrolling\" \"1\"
351 Option \"CircScrollDelta\" \"0.1\"
352 Option \"CircScrollTrigger\" \"8\"
353 # Option \"SHMConfig\" \"on\"
354 # Option \"Repeater\" \"/dev/ps2mouse\"
360 SYNMOUSE='# No alps touchpad detected.'
363 SYNMOUSE='# No synaptics/alps touchpad present.'
367 # USB-PS/2 Optical Mouse
368 if [ -n "$USE_USB" ] ; then
369 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
371 Section \"InputDevice\"
372 Identifier \"USB Mouse\"
374 Option \"Device\" \"/dev/input/mice\"
375 Option \"Protocol\" \"auto\"
376 Option \"ZAxisMapping\" \"4 5\"
377 Option \"Buttons\" \"5\"
378 Option \"SendCoreEvents\" \"true\"
382 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
386 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
388 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
390 Section \"InputDevice\"
391 Identifier \"Serial Mouse\"
393 Option \"Device\" \"/dev/ttyS0\"
394 Option \"Protocol\" \"Microsoft\"
395 Option \"Emulate3Buttons\" \"true\"
396 Option \"Emulate3Timeout\" \"70\"
397 Option \"SendCoreEvents\" \"true\"
401 SERMOUSE='# No serial mouse detected.'
405 # ImExPS/2 Logitech Explorer Mouse
406 # "PS2++ Logitech MX Mouse"
407 if [ -n "$USE_PS2" ] ; then
409 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
411 Section \"InputDevice\"
412 Identifier \"PS/2 Mouse\"
414 Option \"Device\" \"/dev/input/mice\"
415 # Option \"Device\" \"/dev/psaux\"
416 Option \"Protocol\" \"PS/2\"
417 Option \"Emulate3Buttons\" \"true\"
418 Option \"Emulate3Timeout\" \"70\"
419 Option \"SendCoreEvents\" \"true\"
423 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
428 # Section \"InputDevice\"
429 # Identifier \"Generic Mouse\"
431 # Option \"Device\" \"/dev/input/mice\"
432 # Option \"Protocol\" \"auto\"
433 # Option \"ZAxisMapping\" \"4 5\"
434 # Option \"Buttons\" \"5\"
435 # Option \"SendCoreEvents\" \"true\"
446 # commandline parsing {{{
449 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
450 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
451 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
452 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
453 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
456 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
460 if [[ "$o_force" != "" ]]; then
464 if [[ "$o_fallback" != "" ]]; then
466 if [ -r /etc/X11/xorg.conf.example ] ; then
467 sudo cp /etc/X11/xorg.conf.example $XCONFIG
468 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
470 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
475 if [[ "$o_nodpms" != "" ]]; then
476 DPMS='Option "DPMS" "false"'
478 DPMS='Option "DPMS" "true"'
481 if [[ "$o_noddc" != "" ]]; then
485 if [[ "$o_vsync" != "" ]]; then
489 if [[ "$o_hsync" != "" ]]; then
493 if [[ "$o_nousb" != "" ]]; then
494 echo 'Warning: option -nousb is deprecated.'>&2
497 if [[ "$o_usb" != "" ]]; then
501 if [[ "$o_nops2" != "" ]]; then
502 echo 'Warning: optino -nops2 is deprecatedË™'>&2
505 if [[ "$o_ps2" != "" ]]; then
509 if [[ "$o_genmouse" != "" ]]; then
513 if [[ "$o_nosynaptics" != "" ]]; then
519 if [[ "$o_nostart" != "" ]]; then
523 DISPLAY=$o_display[2]
525 eval WINDOWMANAGER=\${$#}
527 if [[ "$XKEYBOARD" == de ]] ; then
529 # Option \"XkbVariant\" \"nodeadkeys\""
532 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
533 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
535 sync # get hsync/vsync
537 if [ -z "$o_hsync" ] ; then
538 o_hsync=(-hsync "$hsyncval")
540 HORIZSYNC=" HorizSync $HSYNC"
542 o_hsync=(-hsync "$o_hsync[2]")
544 HORIZSYNC=" HorizSync $HSYNC"
547 if [ -z "$o_vsync" ] ; then
548 o_vsync=(-vsync "$vsyncval")
550 VERTISYNC=" VertRefresh $VSYNC"
552 o_vsync=(-vsync "$o_vsync[2]")
554 VERTISYNC=" VertRefresh $VSYNC"
557 if [[ "$o_nosync" != "" ]]; then
558 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
559 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
562 if [[ "$o_nohsync" != "" ]]; then
563 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
566 if [[ "$o_novref" != "" ]]; then
567 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
570 if [[ "$o_xinerama" != "" ]]; then
574 if [[ "$o_composite" != "" ]]; then
575 COMPOSITE="Section \"Extensions\"
576 Option \"Composite\" \"Enable\"
579 COMPOSITE="#Section \"Extensions\"
580 # Option \"Composite\" \"Enable\"
588 [ -r "$HWINFO_TMP" ] || bailout 1
589 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
590 [[ $MONITOR != 'ddc' ]] && NODDC=yes
594 if [ -z "$MODULE" ] ; then
595 MODULE="$(getBootParam xmodule 2>/dev/null)"
596 if [ -z "$MODULE" ] ; then
597 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
598 if [ -z "$MODULE" ] ; then
601 # hwinfo >=13.28 reports driver 'intel' instead of i810
602 if [[ "$MODULE" == 'intel' ]] ; then
603 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
610 mouse # get mouse settings
611 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
614 if [ -z $MODE ] ; then
615 B_MODE="$(getBootParam xmode 2>/dev/null)"
616 if [ -n "$B_MODE" ] ; then
617 MODES="Modes \"$B_MODE\""
620 if [ -z "$MODES" ] ; then
621 mode # get available modes
624 MODES="Modes \"$MODE\""
628 print "$fg[green]done$reset_color"
629 print "$bg[black]$fg[white]$bold_color"
630 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
631 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
632 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
633 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
634 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
635 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
636 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
637 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
638 print "${reset_color}"
644 # check for requirements {{{
647 if ! [ -x $(which hwinfo) ] ; then
648 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
649 Note: run 'aptitude install hwinfo' on systems running debian.
650 Exiting.${reset_color}"
654 if ! [[ -d /sys ]] ; then
655 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
656 You may want to add the following line to your /etc/fstab:
658 sysfs /sys sysfs defaults 0 0
660 or just run 'mount /sys'. Exiting.${reset_color}"
670 ################################################################################
672 # Purpose: config file for xserver - generated by grml-x
673 # Bug-Reports: see http://grml.org/bugs/
674 # Latest change: ${DATE}
676 # /usr/share/doc/xserver-xorg/ and
677 # http://wiki.x.org/wiki/Home and
678 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
680 # Refer to the xorg.conf man page and to
681 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
682 # for details about the format of this file.
684 # See http://wiki.debian.org/XStrikeForce/FAQ for information
685 # regarding Xorg packages within Debian.
687 # If you would like this file to be automatically reconfigured by debian,
688 # run the following command:
689 # sudo dpkg-reconfigure -phigh xserver-xorg
690 ################################################################################
692 Section "ServerLayout"
693 Identifier "XServer Configured"
694 Screen 0 "Screen0" 0 0
695 # InputDevice "Keyboard0" "CoreKeyboard"
696 # InputDevice "Generic Mouse" "CorePointer"
697 Option "AutoAddDevices" "off" # do not depend on running dbus/hal
701 Section "ServerFlags"
702 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
703 Option "DontVTSwitch" "false" # allow switching between virtual terminal
704 Option "DontZap" "false" # enable <Crtl><Alt><BS> (server abort)
705 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
709 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
711 # FontPath "/usr/share/fonts/ttf/western"
712 # FontPath "/usr/share/fonts/ttf/decoratives"
713 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
714 FontPath "/usr/share/fonts/latex-ttf-fonts"
715 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
718 # Modules - see /usr/lib/xorg/modules/fonts and /usr/lib/xorg/modules/extensions
720 Load "dbe" # double buffer extension
721 Load "dri" # direct rendering
722 Load "glx" # 3D layer / GLX extension
723 Load "extmod" # some commonly used server extensions (e.g. shape extension)
724 Load "record" # recording extension
725 Load "evdev" # generic input handling driver on Linux
726 Load "xtrap" # X Trap extension
727 # Load "freetype" # freetype fonts rendering
728 # Load "i2c" # I2C bus
729 # Load "int10" # initialize graphics cards via int10 call to the BIOS
730 # Load "type1" # type1 font module
731 # Load "v4l" # Video for Linux
732 # Load "vbe" # Vesa BIOS Extension
733 ## Deprecated/unneeded modules with Xorg >=7.0:
734 # Load "speedo" # font module (does not exist anymore)
735 # Load "ddc" # ddc probing of monitor (automatically loaded)
736 # Load "GLcore" # render OpenGL in software (automatically loaded)
737 # Load "bitmap" # bitmap fonts (automatically loaded)
738 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
739 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
740 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
741 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
742 # xf8_16bpp xf8_32bpp xtrap
745 # If you'd like to switch the positions of your capslock and control keys, use:
746 # Option "XkbOptions" "ctrl:swapcaps"
747 # Or if you just want both to be control, use:
748 # Option "XkbOptions" "ctrl:nocaps"
749 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
750 # Section "InputDevice"
751 # Identifier "Keyboard0"
752 # Option "CoreKeyboard"
754 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
757 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
758 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
760 Identifier "Monitor0"
761 # ModelName "Old Monitor (no DDC)"
763 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
764 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
766 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
767 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
769 # Need more information?
770 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
771 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
775 ### Available Driver options are:
776 ## sw_cursor is needed for some ati and radeon cards
785 # Option "RenderAccel" "true"
786 # Option "AllowGLXWithComposite" "true"
788 # The following line is auto-generated by grml-x
792 ## Workaround for drivers (for example radeon) which might send output to wrong device:
793 # Option "MonitorLayout" "LVDS, AUTO"
794 # Option "MonitorLayout" "LVDS, CRT"
795 # Option "MonitorLayout" "NONE, STV"
796 # Option "MonitorLayout" "LVDS"
836 # Make sure you have the relevant Debian packages on your system
837 # to be able to use DRI (libgl1-mesa-dri for example)
844 ## END OF FILE #################################################################
853 # we do not want to have two CorePointers, deactivate one therefore
854 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
855 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
856 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
859 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
860 sudo mv $XCONFTMP $XCONFIG
861 sudo chown root.root $XCONFIG
862 sudo chmod 644 $XCONFIG
869 if [[ ! -f $XCONFIG ]] ; then
870 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
871 writeit && print "$fg[green]done$reset_color"
873 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
874 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
875 Use the force-option (-force) to force creation.
879 if [[ -n "$FORCE" ]] ; then
880 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
881 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
882 writeit && print "$fg[green]done$reset_color"
891 if [ "$(readlink /etc/X11/X)" = /bin/true ] ; then
892 print "$bold_color$fg[red]Fatal: /etc/X11/X is a symlink to /bin/true."
893 print "Fix it via running 'ln -sf /usr/bin/Xorg /etc/X11/X'"
896 if [ -z "$NOSTART" ] ; then
898 if [ -x /etc/init.d/xorg-common ] ; then
899 sudo /etc/init.d/xorg-common start
901 if [ -x /etc/init.d/xfree86-common ] ; then
902 sudo /etc/init.d/xfree86-common start
906 if [ -z "$DISPLAY" ] ; then
907 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
908 startx $XINITRC -- $XOPTS
911 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
912 startx $XINITRC -- :$DISPLAY $XOPTS
916 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
925 if [ -z "$ROOT" ] ; then
926 if [[ $(tty) == /dev/pts/* ]] ; then
927 print "It seems you are running $PROGRAMNAME from inside GNU screen.
928 Notice that this might fail if running as user grml!
929 Please exit screen and try to run $PROGRAMNAME again."
932 print "Run the following commands for getting information on your hardware:
934 discover -v --data-path=xfree86/server/device/driver display
935 xdebconfigurator -c -d -i -x
936 get-edid | parse-edid
938 Do you want to go the debian way of life? Run:
939 aptitude install xorg read-edid mdetect hwinfo xdebconfigurator
940 dpkg-reconfigure -phigh xserver-xorg
942 Problems with the module used for X? Try to load another one or
943 fall back to module vesa:
944 $PROGRAMNAME -module radeon ...
945 $PROGRAMNAME -module vesa ...
947 Do you want to deactivate a present synaptics touchpad? Run:
948 $PROGRAMNAME -nosynaptics ...
950 Your monitor is very old and/or does not support DDC-probing?
951 $PROGRAMNAME -noddc ...
953 Do you want to create a x configuration file but do not start X?
954 $PROGRAMNAME -nostart ...
956 Monitor frequency too high or too low? Just specify hsync/vsync manually:
957 $PROGRAMNAME -hsync 30-65 ...
958 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
960 Want to adjust the resolution? Use the mode-switch:
961 $PROGRAMNAME -mode 1024x768 ...
962 $PROGRAMNAME -mode '1280x1024 1024x768' ...
964 Problems? Use vesa with resolution 1024x768:
965 $PROGRAMNAME -module vesa -mode 1024x768 ...
967 Still problems with X? Use the fallback option:
968 $PROGRAMNAME -fallback ...
970 To adjust resolution while running X execute:
973 More information on grml-x can be found in the manual page: man grml-x
975 Report bugs, send wishes and feedback to the grml team:
976 http://grml.org/bugs/ - contact (at) grml.org
978 print -n "$reset_color"
994 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
995 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx will not work.${reset_color}">&2
998 if [ -w "$XINITRC" ] ; then
999 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
1002 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
1007 ## END OF FILE #################################################################
1008 # vim:foldmethod=marker expandtab ai ft=zsh