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 HWINFO_TMP="$(mktemp)"
43 MONITORINFO="$(mktemp)"
46 if [ -z "$HWINFO_TMP" ] ; then
47 echo "Fatal: could not create temporary file. Exiting.">&2
51 if [ -r /etc/sysconfig/keyboard ] ; then
52 source /etc/sysconfig/keyboard
58 XCONFIG='/etc/X11/xorg.conf'
59 KEYBOARD="# Driver \"kbd\"
60 # Option \"XkbRules\" \"xfree86\"
61 # Option \"XkbRules\" \"xorg\"
62 # Option \"XkbModel\" \"pc105\"
63 # Option \"XkbLayout\" \"${XKEYBOARD},us\"
64 # Option \"XkbVariant\" \"nodeadkeys\""
67 if [ -d /usr/share/fonts/X11 ] ; then
68 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
69 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
70 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
71 FontPath \"/usr/share/fonts/X11/Type1\"
72 FontPath \"/usr/share/fonts/X11/100dpi\"
73 FontPath \"/usr/share/fonts/X11/75dpi\""
75 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
76 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
78 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
80 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
81 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
82 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
83 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
84 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
85 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
86 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
90 # make sure we don't leave any temp files {{{
92 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
93 [ -n "$1" ] && EXIT="$1" || EXIT="1"
94 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
101 # warn if running as user root {{{
102 if [ -n "$ROOT" ] ; then
103 if [ -r /etc/grml_cd ] ; then
104 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
105 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
106 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
109 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
110 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
114 fstabuser=$(grep ':x:1000:' /etc/passwd)
115 fstabuser=${fstabuser%%[:]*}
118 # usage information {{{
121 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
122 print "$bg[black]$fg[red]$bold_color"
125 $PROGRAMNAME [-options] windowmanager
130 $PROGRAMNAME -force -nostart fluxbox
131 $PROGRAMNAME -nosynaptics fluxbox
132 $PROGRAMNAME -nosync fluxbox
133 $PROGRAMNAME -noddc fluxbox
134 $PROGRAMNAME -xinerama -composite fluxbox
135 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 fluxbox
136 XINITRC=~/.xinitrc $PROGRAMNAME fluxbox
137 $PROGRAMNAME -display 8 fluxbox
139 More information on grml-x can be found in the manual page: man grml-x
141 Report bugs, send wishes and feedback to the grml team:
142 http://grml.org/bugs/ - contact (at) grml.org
144 print "${reset_color}"
152 if [ -n "$ROOT" ] ; then
153 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
155 $HWINFO > $HWINFO_TMP
163 sudo $HWINFO --monitor > $MONITORINFO
170 [ -r "$MONITORINFO" ] || monitor # get monitor settings
171 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
172 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
174 if [ -n "$XINERAMA" ] ; then
178 Option for $fg[yellow]Xinerama$fg[green] found, please use xrandr inside X.org for your further configuration!
179 Trying to identify monitors now..."
181 # make sure we have information from 2 monitors:
182 # - first one from 'hwinfo --monitor' => $MONITORINFO
183 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
184 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
185 if [ -z "$FRAMEBUFFER" ] ; then
187 Fatal: could not identify two monitors - no chance to
188 set up multihead using Xinerama - sorry. :-(
190 Please run grml-x without the -xinerama option to start
191 X anyway (dropping support for Xinerama of course) and
192 contact grml developers if you have any further useful
193 information. => http://grml.org/bugs/
198 # check whether we can read the $MONITORINFO file
199 if ! [ -r "$MONITORINFO" ] ; then
201 Fatal: could not identify monitor - no chance to
202 set up multihead using Xinerama - sorry. :-(
206 # Currently we only know that it works with current intel driver,
207 # so inform user about that:
208 if [[ "$MODULE" != "intel" ]] ; then
211 Warning: using a non-intel driver - trying Xinerama setup anyway.
212 If it worked please contact grml developers providing information
213 about your setup so we can adjust grml-x according!
215 -> http://grml.org/contact/
217 Sleeping for 10 seconds now... Will continue then...
218 Just press Ctrl-C to cancel operation.
223 # now calculate Virtual size for use with Xinerama
224 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
225 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
226 # it might happen that we don't have a Max Resolution in hwinfo output :-/
227 # fall back to a generic value then...
228 # TODO: check out how to get resolution of external monitor from console
229 if [ -z "$HORIZ_RES1" ] ; then
234 # get maximum of output
235 HORIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*: \(.*\)x.*/\1/'| sort -u | head -1)"
236 VERIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*x\(.*\) (.*/\1/' | sort -u | head -1)"
238 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" -a -n "$VERIZ_RES2" ] ; then
239 if [ "$(echo $VERIZ_RES1" - "$VERIZ_RES2 | bc -l)" -eq 0 ] ; then
240 VERIZ_RESULT="$VERIZ_RES1"
241 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
242 VERIZ_RESULT="$VERIZ_RES1"
244 VERIZ_RESULT="$VERIZ_RES2"
247 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
249 # important: keep newline for appropriate placing below $MODES!
250 if [ -n "$HORIZ_RESULT" ] ; then
252 Virtual $HORIZ_RESULT $VERIZ_RES1"
258 if [[ -n $NODDC ]] ; then
259 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
260 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
261 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
263 MODES="# Modes $modes$VIRTUAL"
268 # sync - get hsync/vsync settings {{{
271 [ -r "$MONITORINFO" ] || monitor # get monitor settings
272 [ -r "$MONITORINFO" ] || bailout 1
273 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
274 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
275 if [ -z $vsyncval ] ; then
276 vsyncval='50.0 - 60.0'
278 if [ -z $hsyncval ] ; then
279 hsyncval='28.0 - 96.0'
287 sudo $HWINFO --mouse > $MOUSEINFO
289 # SynPS/2 Synaptics TouchPad
290 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
291 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
292 MOUSEDRIVER='synaptics'
293 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
295 Section \"InputDevice\"
297 Identifier \"Synaptics\"
298 Option \"Device\" \"/dev/psaux\"
299 Option \"Protocol\" \"auto-dev\"
300 Option \"LeftEdge\" \"1700\"
301 Option \"RightEdge\" \"5300\"
302 Option \"TopEdge\" \"1700\"
303 Option \"BottomEdge\" \"4200\"
304 Option \"FingerLow\" \"25\"
305 Option \"FingerHigh\" \"30\"
306 Option \"ZAxisMapping\" \"4 5\"
307 Option \"MaxTapTime\" \"180\"
308 Option \"MaxTapMove\" \"220\"
309 Option \"VertScrollDelta\" \"100\"
310 Option \"MinSpeed\" \"0.06\"
311 Option \"MaxSpeed\" \"0.12\"
312 Option \"AccelFactor\" \"0.0010\"
313 # Option \"SHMConfig\" \"on\"
314 # Option \"Repeater\" \"/dev/ps2mouse\"
320 SYNMOUSE='# No synaptics touchpad detected.'
324 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
325 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
326 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
327 MOUSEDRIVER='synaptics'
328 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
330 Section \"InputDevice\"
332 Identifier \"Synaptics\"
333 Option \"Device\" \"/dev/psaux\"
334 Option \"Protocol\" \"auto-dev\"
335 Option \"LeftEdge\" \"120\"
336 Option \"RightEdge\" \"850\"
337 Option \"TopEdge\" \"120\"
338 Option \"BottomEdge\" \"650\"
339 Option \"FingerLow\" \"14\"
340 Option \"FingerHigh\" \"15\"
341 Option \"ZAxisMapping\" \"4 5\"
342 Option \"MaxTapTime\" \"180\"
343 Option \"MaxTapMove\" \"50\"
344 Option \"MaxDoubleTapTime\" \"100\"
345 Option \"VertScrollDelta\" \"20\"
346 Option \"HorizScrollDelta\" \"20\"
347 Option \"MinSpeed\" \"0.3\"
348 Option \"MaxSpeed\" \"2.00\"
349 Option \"AccelFactor\" \"0.030\"
350 Option \"UpDownScrolling\" \"1\"
351 Option \"EmulateMiddleButtonTime\" \"75\"
352 Option \"CircularScrolling\" \"1\"
353 Option \"CircScrollDelta\" \"0.1\"
354 Option \"CircScrollTrigger\" \"8\"
355 # Option \"SHMConfig\" \"on\"
356 # Option \"Repeater\" \"/dev/ps2mouse\"
362 SYNMOUSE='# No alps touchpad detected.'
365 SYNMOUSE='# No synaptics/alps touchpad present.'
369 # USB-PS/2 Optical Mouse
370 if [ -n "$USE_USB" ] ; then
371 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
373 Section \"InputDevice\"
374 Identifier \"USB Mouse\"
376 Option \"Device\" \"/dev/input/mice\"
377 Option \"Protocol\" \"auto\"
378 Option \"ZAxisMapping\" \"4 5\"
379 Option \"Buttons\" \"5\"
380 Option \"SendCoreEvents\" \"true\"
384 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
388 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
390 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
392 Section \"InputDevice\"
393 Identifier \"Serial Mouse\"
395 Option \"Device\" \"/dev/ttyS0\"
396 Option \"Protocol\" \"Microsoft\"
397 Option \"Emulate3Buttons\" \"true\"
398 Option \"Emulate3Timeout\" \"70\"
399 Option \"SendCoreEvents\" \"true\"
403 SERMOUSE='# No serial mouse detected.'
407 # ImExPS/2 Logitech Explorer Mouse
408 # "PS2++ Logitech MX Mouse"
409 if [ -n "$USE_PS2" ] ; then
411 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
413 Section \"InputDevice\"
414 Identifier \"PS/2 Mouse\"
416 Option \"Device\" \"/dev/input/mice\"
417 # Option \"Device\" \"/dev/psaux\"
418 Option \"Protocol\" \"PS/2\"
419 Option \"Emulate3Buttons\" \"true\"
420 Option \"Emulate3Timeout\" \"70\"
421 Option \"SendCoreEvents\" \"true\"
425 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
430 # Section \"InputDevice\"
431 # Identifier \"Generic Mouse\"
433 # Option \"Device\" \"/dev/input/mice\"
434 # Option \"Protocol\" \"auto\"
435 # Option \"ZAxisMapping\" \"4 5\"
436 # Option \"Buttons\" \"5\"
437 # Option \"SendCoreEvents\" \"true\"
448 # commandline parsing {{{
451 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
452 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
453 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
454 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
455 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
458 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
462 if [[ "$o_force" != "" ]]; then
466 if [[ "$o_fallback" != "" ]]; then
468 if [ -r /etc/X11/xorg.conf.example ] ; then
469 sudo cp /etc/X11/xorg.conf.example $XCONFIG
470 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
472 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
477 if [[ "$o_nodpms" != "" ]]; then
478 DPMS='Option "DPMS" "false"'
480 DPMS='Option "DPMS" "true"'
483 if [[ "$o_noddc" != "" ]]; then
487 if [[ "$o_vsync" != "" ]]; then
491 if [[ "$o_hsync" != "" ]]; then
495 if [[ "$o_nousb" != "" ]]; then
496 echo 'Warning: option -nousb is deprecated.'>&2
499 if [[ "$o_usb" != "" ]]; then
503 if [[ "$o_nops2" != "" ]]; then
504 echo 'Warning: optino -nops2 is deprecatedË™'>&2
507 if [[ "$o_ps2" != "" ]]; then
511 if [[ "$o_genmouse" != "" ]]; then
515 if [[ "$o_nosynaptics" != "" ]]; then
521 if [[ "$o_nostart" != "" ]]; then
525 DISPLAY=$o_display[2]
527 eval WINDOWMANAGER=\${$#}
529 if [[ "$XKEYBOARD" == de ]] ; then
531 # Option \"XkbVariant\" \"nodeadkeys\""
534 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
535 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
537 sync # get hsync/vsync
539 if [ -z "$o_hsync" ] ; then
540 o_hsync=(-hsync "$hsyncval")
542 HORIZSYNC=" HorizSync $HSYNC"
544 o_hsync=(-hsync "$o_hsync[2]")
546 HORIZSYNC=" HorizSync $HSYNC"
549 if [ -z "$o_vsync" ] ; then
550 o_vsync=(-vsync "$vsyncval")
552 VERTISYNC=" VertRefresh $VSYNC"
554 o_vsync=(-vsync "$o_vsync[2]")
556 VERTISYNC=" VertRefresh $VSYNC"
559 if [[ "$o_nosync" != "" ]]; then
560 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
561 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
564 if [[ "$o_nohsync" != "" ]]; then
565 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
568 if [[ "$o_novref" != "" ]]; then
569 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
572 if [[ "$o_xinerama" != "" ]]; then
576 if [[ "$o_composite" != "" ]]; then
577 COMPOSITE="Section \"Extensions\"
578 Option \"Composite\" \"Enable\"
581 COMPOSITE="#Section \"Extensions\"
582 # Option \"Composite\" \"Enable\"
590 [ -r "$HWINFO_TMP" ] || bailout 1
591 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
592 [[ $MONITOR != 'ddc' ]] && NODDC=yes
596 if [ -z "$MODULE" ] ; then
597 MODULE="$(getBootParam xmodule 2>/dev/null)"
598 if [ -z "$MODULE" ] ; then
599 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
600 if [ -z "$MODULE" ] ; then
603 # hwinfo >=13.28 reports driver 'intel' instead of i810
604 if [[ "$MODULE" == 'intel' ]] ; then
605 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
612 mouse # get mouse settings
613 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
616 if [ -z $MODE ] ; then
617 B_MODE="$(getBootParam xmode 2>/dev/null)"
618 if [ -n "$B_MODE" ] ; then
619 MODES="Modes \"$B_MODE\""
622 if [ -z "$MODES" ] ; then
623 mode # get available modes
626 MODES="Modes \"$MODE\""
630 print "$fg[green]done$reset_color"
631 print "$bg[black]$fg[white]$bold_color"
632 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
633 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
634 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
635 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
636 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
637 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
638 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
639 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
640 print "${reset_color}"
646 # check for requirements {{{
649 if ! [ -x $(which hwinfo) ] ; then
650 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
651 Note: run 'aptitude install hwinfo' on systems running debian.
652 Exiting.${reset_color}"
656 if ! [[ -d /sys ]] ; then
657 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
658 You may want to add the following line to your /etc/fstab:
660 sysfs /sys sysfs defaults 0 0
662 or just run 'mount /sys'. Exiting.${reset_color}"
672 ################################################################################
674 # Purpose: config file for xserver - generated by grml-x
675 # Bug-Reports: see http://grml.org/bugs/
676 # Latest change: ${DATE}
678 # /usr/share/doc/xserver-xorg/ and
679 # http://wiki.x.org/wiki/Home and
680 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
682 # Refer to the xorg.conf man page and to
683 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
684 # for details about the format of this file.
686 # See http://wiki.debian.org/XStrikeForce/FAQ for information
687 # regarding Xorg packages within Debian.
689 # If you would like this file to be automatically reconfigured by debian,
690 # run the following command:
691 # sudo dpkg-reconfigure -phigh xserver-xorg
692 ################################################################################
694 Section "ServerLayout"
695 Identifier "XServer Configured"
696 Screen 0 "Screen0" 0 0
697 # InputDevice "Keyboard0" "CoreKeyboard"
698 # InputDevice "Generic Mouse" "CorePointer"
702 Section "ServerFlags"
703 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
704 Option "DontVTSwitch" "false" # allow switching between virtual terminal
705 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
706 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
710 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
712 # FontPath "/usr/share/fonts/ttf/western"
713 # FontPath "/usr/share/fonts/ttf/decoratives"
714 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
715 FontPath "/usr/share/fonts/latex-ttf-fonts"
716 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
719 # Modules - see /usr/lib/xorg/modules/fonts and /usr/lib/xorg/modules/extensions
721 Load "dbe" # double buffer extension
722 Load "dri" # direct rendering
723 Load "glx" # 3D layer / GLX extension
724 Load "type1" # type1 font module
725 Load "freetype" # freetype fonts rendering
726 Load "extmod" # some commonly used server extensions (e.g. shape extension)
727 Load "record" # recording extension
728 Load "evdev" # generic input handling driver on Linux
729 Load "xtrap" # X Trap extension
730 # Load "vbe" # Vesa BIOS Extension
731 # Load "i2c" # I2C bus
732 # Load "int10" # initialize graphics cards via int10 call to the BIOS
733 # Load "v4l" # Video for Linux
734 ## Deprecated/unneeded modules with Xorg >=7.0:
735 # Load "speedo" # font module (does not exist anymore)
736 # Load "ddc" # ddc probing of monitor (automatically loaded)
737 # Load "GLcore" # render OpenGL in software (automatically loaded)
738 # Load "bitmap" # bitmap fonts (automatically loaded)
739 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
740 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
741 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
742 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
743 # xf8_16bpp xf8_32bpp xtrap
746 # If you'd like to switch the positions of your capslock and control keys, use:
747 # Option "XkbOptions" "ctrl:swapcaps"
748 # Or if you just want both to be control, use:
749 # Option "XkbOptions" "ctrl:nocaps"
750 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
751 # Section "InputDevice"
752 # Identifier "Keyboard0"
753 # Option "CoreKeyboard"
755 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
758 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
759 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
761 Identifier "Monitor0"
762 # ModelName "Old Monitor (no DDC)"
764 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
765 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
767 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
768 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
770 # Need more information?
771 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
772 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
776 ### Available Driver options are:
777 ## sw_cursor is needed for some ati and radeon cards
786 # Option "RenderAccel" "true"
787 # Option "AllowGLXWithComposite" "true"
789 # The following line is auto-generated by grml-x
793 ## Workaround for drivers (for example radeon) which might send output to wrong device:
794 # Option "MonitorLayout" "LVDS, AUTO"
795 # Option "MonitorLayout" "LVDS, CRT"
796 # Option "MonitorLayout" "NONE, STV"
797 # Option "MonitorLayout" "LVDS"
837 # Make sure you have the relevant Debian packages on your system
838 # to be able to use DRI (libgl1-mesa-dri for example)
845 ## END OF FILE #################################################################
854 # we do not want to have two CorePointers, deactivate one therefore
855 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
856 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
857 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
860 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
861 sudo mv $XCONFTMP $XCONFIG
862 sudo chown root.root $XCONFIG
863 sudo chmod 644 $XCONFIG
870 if [[ ! -f $XCONFIG ]] ; then
871 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
872 writeit && print "$fg[green]done$reset_color"
874 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
875 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
876 Use the force-option (-force) to force creation.
880 if [[ -n "$FORCE" ]] ; then
881 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
882 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
883 writeit && print "$fg[green]done$reset_color"
892 if [ "$(readlink /etc/X11/X)" = /bin/true ] ; then
893 print "$bold_color$fg[red]Fatal: /etc/X11/X is a symlink to /bin/true."
894 print "Fix it via running 'ln -sf /usr/bin/Xorg /etc/X11/X'"
897 if [ -z "$NOSTART" ] ; then
899 if [ -x /etc/init.d/xorg-common ] ; then
900 sudo /etc/init.d/xorg-common start
902 if [ -x /etc/init.d/xfree86-common ] ; then
903 sudo /etc/init.d/xfree86-common start
907 if [ -z "$DISPLAY" ] ; then
908 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
909 startx $XINITRC -- $XOPTS
912 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
913 startx $XINITRC -- :$DISPLAY $XOPTS
917 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
926 if [ -z "$ROOT" ] ; then
927 if [[ $(tty) == /dev/pts/* ]] ; then
928 print "It seems you are running $PROGRAMNAME from inside GNU screen.
929 Notice that this might fail if running as user grml!
930 Please exit screen and try to run $PROGRAMNAME again."
933 print "Run the following commands for getting information on your hardware:
935 discover -v --data-path=xfree86/server/device/driver display
936 xdebconfigurator -c -d -i -x
937 get-edid | parse-edid
939 Do you want to go the debian way of life? Run:
940 aptitude install xorg read-edid mdetect hwinfo xdebconfigurator
941 dpkg-reconfigure -phigh xserver-xorg
943 Problems with the module used for X? Try to load another one or
944 fall back to module vesa:
945 $PROGRAMNAME -module radeon ...
946 $PROGRAMNAME -module vesa ...
948 Do you want to deactivate a present synaptics touchpad? Run:
949 $PROGRAMNAME -nosynaptics ...
951 Your monitor is very old and/or does not support DDC-probing?
952 $PROGRAMNAME -noddc ...
954 Do you want to create a x configuration file but do not start X?
955 $PROGRAMNAME -nostart ...
957 Monitor frequency too high or too low? Just specify hsync/vsync manually:
958 $PROGRAMNAME -hsync 30-65 ...
959 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
961 Want to adjust the resolution? Use the mode-switch:
962 $PROGRAMNAME -mode 1024x768 ...
963 $PROGRAMNAME -mode '1280x1024 1024x768' ...
965 Problems? Use vesa with resolution 1024x768:
966 $PROGRAMNAME -module vesa -mode 1024x768 ...
968 Still problems with X? Use the fallback option:
969 $PROGRAMNAME -fallback ...
971 To adjust resolution while running X execute:
974 More information on grml-x can be found in the manual page: man grml-x
976 Report bugs, send wishes and feedback to the grml team:
977 http://grml.org/bugs/ - contact (at) grml.org
979 print -n "$reset_color"
995 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
996 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx will not work.${reset_color}">&2
999 if [ -w "$XINITRC" ] ; then
1000 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
1003 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
1008 ## END OF FILE #################################################################
1009 # vim:foldmethod=marker expandtab ai ft=zsh