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 . /usr/lib/grml/core.sh
13 # usage: DEBUG=1 grml-x ..... 2>/tmp/grml-x-debug.log
14 if [[ $DEBUG -gt 0 ]]; then
19 # functions and color {{{
20 # use colors only if not booted with nocolor bootoption
21 if ! checkbootparam nocolor ; then
22 autoload colors ; colors
23 [ -r /etc/grml_colors ] && . /etc/grml_colors
26 # some functions like getBootParam
27 if [ -r /etc/grml/script-functions -a -r /etc/grml/sh-lib ] ; then
28 source /etc/grml/script-functions
29 source /etc/grml/sh-lib
31 echo 'Error: sourcing function files failed. Exiting.'
35 check4root &>/dev/null && ROOT='1' || ROOT=''
40 HWINFO='/usr/sbin/hwinfo'
42 [ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
45 # notice: we need the unsafe option, otherwise users other than root
46 # can not write to HWINFO_TMP, but we don't want to run hwinfo as root
47 HWINFO_TMP="$(mktemp -u)" || exit 1
48 MONITORINFO="$(mktemp)" || exit 1
49 MOUSEINFO="$(mktemp)" || exit 1
51 if [ -z "$HWINFO_TMP" ] ; then
52 echo "Fatal: could not create temporary file. Exiting.">&2
56 if [ -r /etc/sysconfig/keyboard ] ; then
57 source /etc/sysconfig/keyboard
63 XCONFIG='/etc/X11/xorg.conf'
64 KEYBOARD="# Driver \"kbd\"
65 # Option \"XkbRules\" \"xfree86\"
66 # Option \"XkbRules\" \"xorg\"
67 # Option \"XkbModel\" \"pc105\"
68 # Option \"XkbLayout\" \"${XKEYBOARD},us\"
69 # Option \"XkbVariant\" \"nodeadkeys\""
72 if [ -d /usr/share/fonts/X11 ] ; then
73 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
74 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
75 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
76 FontPath \"/usr/share/fonts/X11/Type1\"
77 FontPath \"/usr/share/fonts/X11/100dpi\"
78 FontPath \"/usr/share/fonts/X11/75dpi\""
80 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
81 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
83 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
85 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
86 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
87 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
88 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
89 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
90 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
91 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
95 # make sure we don't leave any temp files {{{
97 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
98 [ -n "$1" ] && EXIT="$1" || EXIT="1"
99 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
103 trap bailout 1 2 3 15
106 # warn if running as user root {{{
107 if [ -n "$ROOT" ] ; then
108 if [ -r /etc/grml_cd ] ; then
109 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
110 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
111 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
114 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
115 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
119 fstabuser=$(grep ':x:1000:' /etc/passwd)
120 fstabuser=${fstabuser%%[:]*}
123 # usage information {{{
126 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
127 print "$bg[black]$fg[red]$bold_color"
130 $PROGRAMNAME [-options] windowmanager
135 $PROGRAMNAME -force -nostart fluxbox
136 $PROGRAMNAME -nosynaptics fluxbox
137 $PROGRAMNAME -nosync fluxbox
138 $PROGRAMNAME -noddc fluxbox
139 $PROGRAMNAME -xinerama -composite fluxbox
140 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 fluxbox
141 XINITRC=~/.xinitrc $PROGRAMNAME fluxbox
142 $PROGRAMNAME -display 8 fluxbox
144 More information on grml-x can be found in the manual page: man grml-x
146 Report bugs, send wishes and feedback to the grml team:
147 http://grml.org/bugs/ - contact (at) grml.org
149 print "${reset_color}"
157 if [ -n "$ROOT" ] ; then
158 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
160 $HWINFO > $HWINFO_TMP
168 sudo $HWINFO --monitor > $MONITORINFO
175 [ -r "$MONITORINFO" ] || monitor # get monitor settings
176 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
177 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
179 if [ -n "$XINERAMA" ] ; then
183 Option for $fg[yellow]Xinerama$fg[green] found, please use xrandr inside X.org for your further configuration!
184 Trying to identify monitors now..."
186 # make sure we have information from 2 monitors:
187 # - first one from 'hwinfo --monitor' => $MONITORINFO
188 # - second one from 'hwinfo --framebuffer' => $FRAMEBUFFER
189 FRAMEBUFFER=$(hwinfo --framebuffer | grep 'Mode 0x.* bits' | head -1)
190 if [ -z "$FRAMEBUFFER" ] ; then
192 Fatal: could not identify two monitors - no chance to
193 set up multihead using Xinerama - sorry. :-(
195 Please run grml-x without the -xinerama option to start
196 X anyway (dropping support for Xinerama of course) and
197 contact grml developers if you have any further useful
198 information. => http://grml.org/bugs/
203 # check whether we can read the $MONITORINFO file
204 if ! [ -r "$MONITORINFO" ] ; then
206 Fatal: could not identify monitor - no chance to
207 set up multihead using Xinerama - sorry. :-(
211 # Currently we only know that it works with current intel driver,
212 # so inform user about that:
213 if [[ "$MODULE" != "intel" ]] ; then
216 Warning: using a non-intel driver - trying Xinerama setup anyway.
217 If it worked please contact grml developers providing information
218 about your setup so we can adjust grml-x according!
220 -> http://grml.org/contact/
222 Sleeping for 10 seconds now... Will continue then...
223 Just press Ctrl-C to cancel operation.
228 # now calculate Virtual size for use with Xinerama
229 HORIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\1/')"
230 VERIZ_RES1="$(grep 'Max. Resolution:' $MONITORINFO | sed 's/ Max\. Resolution: \(.*\)x\(.*\)/\2/')"
231 # it might happen that we don't have a Max Resolution in hwinfo output :-/
232 # fall back to a generic value then...
233 # TODO: check out how to get resolution of external monitor from console
234 if [ -z "$HORIZ_RES1" ] ; then
239 # get maximum of output
240 HORIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*: \(.*\)x.*/\1/'| sort -u | head -1)"
241 VERIZ_RES2="$(echo $FRAMEBUFFER | grep 'Mode 0x' | sed 's/ Mode 0x.*x\(.*\) (.*/\1/' | sort -u | head -1)"
243 if [ -n "$HORIZ_RES1" -a -n "$VERIZ_RES1" -a -n "$HORIZ_RES2" -a -n "$VERIZ_RES2" ] ; then
244 if [ "$(echo $VERIZ_RES1" - "$VERIZ_RES2 | bc -l)" -eq 0 ] ; then
245 VERIZ_RESULT="$VERIZ_RES1"
246 elif [ "$VERIZ_RES1" -gt "$VERIZ_RES2" ] ; then
247 VERIZ_RESULT="$VERIZ_RES1"
249 VERIZ_RESULT="$VERIZ_RES2"
252 HORIZ_RESULT=$(echo $HORIZ_RES1 + $HORIZ_RES2 | bc -l)
254 # important: keep newline for appropriate placing below $MODES!
255 if [ -n "$HORIZ_RESULT" ] ; then
257 Virtual $HORIZ_RESULT $VERIZ_RES1"
263 if [[ -n $NODDC ]] ; then
264 MODES="Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
265 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
266 MODES="# Modes \"1024x768\" \"800x600\" \"640x480\" \"1600x1200\" \"1280x1024\" \"1280x960\"$VIRTUAL"
268 MODES="# Modes $modes$VIRTUAL"
273 # sync - get hsync/vsync settings {{{
276 [ -r "$MONITORINFO" ] || monitor # get monitor settings
277 [ -r "$MONITORINFO" ] || bailout 1
278 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
279 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
280 if [ -z $vsyncval ] ; then
281 vsyncval='50.0 - 60.0'
283 if [ -z $hsyncval ] ; then
284 hsyncval='28.0 - 96.0'
292 sudo $HWINFO --mouse > $MOUSEINFO
294 # SynPS/2 Synaptics TouchPad
295 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
296 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
297 MOUSEDRIVER='synaptics'
298 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
300 Section \"InputDevice\"
302 Identifier \"Synaptics\"
303 Option \"Device\" \"/dev/psaux\"
304 Option \"Protocol\" \"auto-dev\"
305 Option \"LeftEdge\" \"1700\"
306 Option \"RightEdge\" \"5300\"
307 Option \"TopEdge\" \"1700\"
308 Option \"BottomEdge\" \"4200\"
309 Option \"FingerLow\" \"25\"
310 Option \"FingerHigh\" \"30\"
311 Option \"ZAxisMapping\" \"4 5\"
312 Option \"MaxTapTime\" \"180\"
313 Option \"MaxTapMove\" \"220\"
314 Option \"VertScrollDelta\" \"100\"
315 Option \"MinSpeed\" \"0.06\"
316 Option \"MaxSpeed\" \"0.12\"
317 Option \"AccelFactor\" \"0.0010\"
318 # Option \"SHMConfig\" \"on\"
319 # Option \"Repeater\" \"/dev/ps2mouse\"
325 SYNMOUSE='# No synaptics touchpad detected.'
329 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
330 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
331 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
332 MOUSEDRIVER='synaptics'
333 SYNMOUSE='InputDevice "Synaptics" # "AlwaysCore"'
335 Section \"InputDevice\"
337 Identifier \"Synaptics\"
338 Option \"Device\" \"/dev/psaux\"
339 Option \"Protocol\" \"auto-dev\"
340 Option \"LeftEdge\" \"120\"
341 Option \"RightEdge\" \"850\"
342 Option \"TopEdge\" \"120\"
343 Option \"BottomEdge\" \"650\"
344 Option \"FingerLow\" \"14\"
345 Option \"FingerHigh\" \"15\"
346 Option \"ZAxisMapping\" \"4 5\"
347 Option \"MaxTapTime\" \"180\"
348 Option \"MaxTapMove\" \"50\"
349 Option \"MaxDoubleTapTime\" \"100\"
350 Option \"VertScrollDelta\" \"20\"
351 Option \"HorizScrollDelta\" \"20\"
352 Option \"MinSpeed\" \"0.3\"
353 Option \"MaxSpeed\" \"2.00\"
354 Option \"AccelFactor\" \"0.030\"
355 Option \"UpDownScrolling\" \"1\"
356 Option \"EmulateMiddleButtonTime\" \"75\"
357 Option \"CircularScrolling\" \"1\"
358 Option \"CircScrollDelta\" \"0.1\"
359 Option \"CircScrollTrigger\" \"8\"
360 # Option \"SHMConfig\" \"on\"
361 # Option \"Repeater\" \"/dev/ps2mouse\"
367 SYNMOUSE='# No alps touchpad detected.'
370 SYNMOUSE='# No synaptics/alps touchpad present.'
374 # USB-PS/2 Optical Mouse
375 if [ -n "$USE_USB" ] ; then
376 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
378 Section \"InputDevice\"
379 Identifier \"USB Mouse\"
381 Option \"Device\" \"/dev/input/mice\"
382 Option \"Protocol\" \"auto\"
383 Option \"ZAxisMapping\" \"4 5\"
384 Option \"Buttons\" \"5\"
385 Option \"SendCoreEvents\" \"true\"
389 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
393 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
395 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
397 Section \"InputDevice\"
398 Identifier \"Serial Mouse\"
400 Option \"Device\" \"/dev/ttyS0\"
401 Option \"Protocol\" \"Microsoft\"
402 Option \"Emulate3Buttons\" \"true\"
403 Option \"Emulate3Timeout\" \"70\"
404 Option \"SendCoreEvents\" \"true\"
408 SERMOUSE='# No serial mouse detected.'
412 # ImExPS/2 Logitech Explorer Mouse
413 # "PS2++ Logitech MX Mouse"
414 if [ -n "$USE_PS2" ] ; then
416 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
418 Section \"InputDevice\"
419 Identifier \"PS/2 Mouse\"
421 Option \"Device\" \"/dev/input/mice\"
422 # Option \"Device\" \"/dev/psaux\"
423 Option \"Protocol\" \"PS/2\"
424 Option \"Emulate3Buttons\" \"true\"
425 Option \"Emulate3Timeout\" \"70\"
426 Option \"SendCoreEvents\" \"true\"
430 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
435 # Section \"InputDevice\"
436 # Identifier \"Generic Mouse\"
438 # Option \"Device\" \"/dev/input/mice\"
439 # Option \"Protocol\" \"auto\"
440 # Option \"ZAxisMapping\" \"4 5\"
441 # Option \"Buttons\" \"5\"
442 # Option \"SendCoreEvents\" \"true\"
453 # commandline parsing {{{
456 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
457 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
458 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
459 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
460 fallback=o_fallback usb=o_usb ps2=o_ps2 composite=o_composite \
463 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
467 if [[ "$o_force" != "" ]]; then
471 if [[ "$o_fallback" != "" ]]; then
473 if [ -r /etc/X11/xorg.conf.example ] ; then
474 sudo cp /etc/X11/xorg.conf.example $XCONFIG
475 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
477 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
482 if [[ "$o_nodpms" != "" ]]; then
483 DPMS='Option "DPMS" "false"'
485 DPMS='Option "DPMS" "true"'
488 if [[ "$o_noddc" != "" ]]; then
492 if [[ "$o_vsync" != "" ]]; then
496 if [[ "$o_hsync" != "" ]]; then
500 if [[ "$o_nousb" != "" ]]; then
501 echo 'Warning: option -nousb is deprecated.'>&2
504 if [[ "$o_usb" != "" ]]; then
508 if [[ "$o_nops2" != "" ]]; then
509 echo 'Warning: optino -nops2 is deprecatedË™'>&2
512 if [[ "$o_ps2" != "" ]]; then
516 if [[ "$o_genmouse" != "" ]]; then
520 if [[ "$o_nosynaptics" != "" ]]; then
526 if [[ "$o_nostart" != "" ]]; then
530 DISPLAY=$o_display[2]
532 eval WINDOWMANAGER=\${$#}
534 if [[ "$XKEYBOARD" == de ]] ; then
536 # Option \"XkbVariant\" \"nodeadkeys\""
539 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
540 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
542 sync # get hsync/vsync
544 if [ -z "$o_hsync" ] ; then
545 o_hsync=(-hsync "$hsyncval")
547 HORIZSYNC=" HorizSync $HSYNC"
549 o_hsync=(-hsync "$o_hsync[2]")
551 HORIZSYNC=" HorizSync $HSYNC"
554 if [ -z "$o_vsync" ] ; then
555 o_vsync=(-vsync "$vsyncval")
557 VERTISYNC=" VertRefresh $VSYNC"
559 o_vsync=(-vsync "$o_vsync[2]")
561 VERTISYNC=" VertRefresh $VSYNC"
564 if [[ "$o_nosync" != "" ]]; then
565 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
566 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
569 if [[ "$o_nohsync" != "" ]]; then
570 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
573 if [[ "$o_novref" != "" ]]; then
574 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
577 if [[ "$o_xinerama" != "" ]]; then
581 if [[ "$o_composite" != "" ]]; then
582 COMPOSITE="Section \"Extensions\"
583 Option \"Composite\" \"Enable\"
586 COMPOSITE="#Section \"Extensions\"
587 # Option \"Composite\" \"Enable\"
595 [ -r "$HWINFO_TMP" ] || bailout 1
596 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
597 [[ $MONITOR != 'ddc' ]] && NODDC=yes
601 if [ -z "$MODULE" ] ; then
602 MODULE="$(getBootParam xmodule 2>/dev/null)"
603 if [ -z "$MODULE" ] ; then
604 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
605 if [ -z "$MODULE" ] ; then
608 # hwinfo >=13.28 reports driver 'intel' instead of i810
609 if [[ "$MODULE" == 'intel' ]] ; then
610 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
617 mouse # get mouse settings
618 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
621 if [ -z $MODE ] ; then
622 B_MODE="$(getBootParam xmode 2>/dev/null)"
623 if [ -n "$B_MODE" ] ; then
624 MODES="Modes \"$B_MODE\""
627 if [ -z "$MODES" ] ; then
628 mode # get available modes
631 MODES="Modes \"$MODE\""
635 print "$fg[green]done$reset_color"
636 print "$bg[black]$fg[white]$bold_color"
637 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
638 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
639 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
640 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
641 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
642 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
643 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
644 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
645 print "${reset_color}"
651 # check for requirements {{{
654 if ! [ -x $(which hwinfo) ] ; then
655 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
656 Note: run 'aptitude install hwinfo' on systems running debian.
657 Exiting.${reset_color}"
661 if ! [[ -d /sys ]] ; then
662 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
663 You may want to add the following line to your /etc/fstab:
665 sysfs /sys sysfs defaults 0 0
667 or just run 'mount /sys'. Exiting.${reset_color}"
677 ################################################################################
679 # Purpose: config file for xserver - generated by grml-x
680 # Bug-Reports: see http://grml.org/bugs/
681 # Latest change: ${DATE}
683 # /usr/share/doc/xserver-xorg/ and
684 # http://wiki.x.org/wiki/Home and
685 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
687 # Refer to the xorg.conf man page and to
688 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
689 # for details about the format of this file.
691 # See http://wiki.debian.org/XStrikeForce/FAQ for information
692 # regarding Xorg packages within Debian.
694 # If you would like this file to be automatically reconfigured by debian,
695 # run the following command:
696 # sudo dpkg-reconfigure -phigh xserver-xorg
697 ################################################################################
699 Section "ServerLayout"
700 Identifier "XServer Configured"
701 Screen 0 "Screen0" 0 0
702 # InputDevice "Keyboard0" "CoreKeyboard"
703 # InputDevice "Generic Mouse" "CorePointer"
704 Option "AutoAddDevices" "off" # do not depend on running dbus/hal
708 Section "ServerFlags"
709 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
710 Option "DontVTSwitch" "false" # allow switching between virtual terminal
711 Option "DontZap" "false" # enable <Crtl><Alt><BS> (server abort)
712 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
716 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
718 # FontPath "/usr/share/fonts/ttf/western"
719 # FontPath "/usr/share/fonts/ttf/decoratives"
720 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
721 FontPath "/usr/share/fonts/latex-ttf-fonts"
722 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
725 # Modules - see /usr/lib/xorg/modules/fonts and /usr/lib/xorg/modules/extensions
727 Load "dbe" # double buffer extension
728 Load "dri" # direct rendering
729 Load "glx" # 3D layer / GLX extension
730 Load "extmod" # some commonly used server extensions (e.g. shape extension)
731 Load "record" # recording extension
732 Load "evdev" # generic input handling driver on Linux
733 Load "xtrap" # X Trap extension
734 # Load "freetype" # freetype fonts rendering
735 # Load "i2c" # I2C bus
736 # Load "int10" # initialize graphics cards via int10 call to the BIOS
737 # Load "type1" # type1 font module
738 # Load "v4l" # Video for Linux
739 # Load "vbe" # Vesa BIOS Extension
740 ## Deprecated/unneeded modules with Xorg >=7.0:
741 # Load "speedo" # font module (does not exist anymore)
742 # Load "ddc" # ddc probing of monitor (automatically loaded)
743 # Load "GLcore" # render OpenGL in software (automatically loaded)
744 # Load "bitmap" # bitmap fonts (automatically loaded)
745 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
746 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
747 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
748 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
749 # xf8_16bpp xf8_32bpp xtrap
752 # If you'd like to switch the positions of your capslock and control keys, use:
753 # Option "XkbOptions" "ctrl:swapcaps"
754 # Or if you just want both to be control, use:
755 # Option "XkbOptions" "ctrl:nocaps"
756 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
757 # Section "InputDevice"
758 # Identifier "Keyboard0"
759 # Option "CoreKeyboard"
761 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
764 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
765 ${USBMOUSEDETAIL}${PS2MOUSEDETAIL}${SERMOUSEDETAIL}${SYNMOUSEDETAIL}${EVDEV_MOUSE}
767 Identifier "Monitor0"
768 # ModelName "Old Monitor (no DDC)"
770 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
771 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
773 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
774 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
776 # Need more information?
777 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
778 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
782 ### Available Driver options are:
783 ## sw_cursor is needed for some ati and radeon cards
792 # Option "RenderAccel" "true"
793 # Option "AllowGLXWithComposite" "true"
795 # The following line is auto-generated by grml-x
799 ## Workaround for drivers (for example radeon) which might send output to wrong device:
800 # Option "MonitorLayout" "LVDS, AUTO"
801 # Option "MonitorLayout" "LVDS, CRT"
802 # Option "MonitorLayout" "NONE, STV"
803 # Option "MonitorLayout" "LVDS"
843 # Make sure you have the relevant Debian packages on your system
844 # to be able to use DRI (libgl1-mesa-dri for example)
851 ## END OF FILE #################################################################
860 # we do not want to have two CorePointers, deactivate one therefore
861 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
862 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
863 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
866 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
867 sudo mv $XCONFTMP $XCONFIG
868 sudo chown root.root $XCONFIG
869 sudo chmod 644 $XCONFIG
876 if [[ ! -f $XCONFIG ]] ; then
877 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
878 writeit && print "$fg[green]done$reset_color"
880 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
881 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
882 Use the force-option (-force) to force creation.
886 if [[ -n "$FORCE" ]] ; then
887 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
888 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
889 writeit && print "$fg[green]done$reset_color"
898 if [ "$(readlink /etc/X11/X)" = /bin/true ] ; then
899 print "$bold_color$fg[red]Fatal: /etc/X11/X is a symlink to /bin/true."
900 print "Fix it via running 'ln -sf /usr/bin/Xorg /etc/X11/X'"
903 if [ -z "$NOSTART" ] ; then
905 if [ -x /etc/init.d/xorg-common ] ; then
906 sudo /etc/init.d/xorg-common start
908 if [ -x /etc/init.d/xfree86-common ] ; then
909 sudo /etc/init.d/xfree86-common start
913 if [ -z "$DISPLAY" ] ; then
914 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
915 startx $XINITRC -- $XOPTS
918 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
919 startx $XINITRC -- :$DISPLAY $XOPTS
923 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
932 if [ -z "$ROOT" ] ; then
933 if [[ $(tty) == /dev/pts/* ]] ; then
934 print "It seems you are running $PROGRAMNAME from inside GNU screen.
935 Notice that this might fail if running as user grml!
936 Please exit screen and try to run $PROGRAMNAME again."
939 print "Run the following commands for getting information on your hardware:
941 discover -v --data-path=xfree86/server/device/driver display
942 xdebconfigurator -c -d -i -x
943 get-edid | parse-edid
945 Do you want to go the debian way of life? Run:
946 aptitude install xorg read-edid mdetect hwinfo xdebconfigurator
947 dpkg-reconfigure -phigh xserver-xorg
949 Problems with the module used for X? Try to load another one or
950 fall back to module vesa:
951 $PROGRAMNAME -module radeon ...
952 $PROGRAMNAME -module vesa ...
954 Do you want to deactivate a present synaptics touchpad? Run:
955 $PROGRAMNAME -nosynaptics ...
957 Your monitor is very old and/or does not support DDC-probing?
958 $PROGRAMNAME -noddc ...
960 Do you want to create a x configuration file but do not start X?
961 $PROGRAMNAME -nostart ...
963 Monitor frequency too high or too low? Just specify hsync/vsync manually:
964 $PROGRAMNAME -hsync 30-65 ...
965 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
967 Want to adjust the resolution? Use the mode-switch:
968 $PROGRAMNAME -mode 1024x768 ...
969 $PROGRAMNAME -mode '1280x1024 1024x768' ...
971 Problems? Use vesa with resolution 1024x768:
972 $PROGRAMNAME -module vesa -mode 1024x768 ...
974 Still problems with X? Use the fallback option:
975 $PROGRAMNAME -fallback ...
977 To adjust resolution while running X execute:
980 More information on grml-x can be found in the manual page: man grml-x
982 Report bugs, send wishes and feedback to the grml team:
983 http://grml.org/bugs/ - contact (at) grml.org
985 print -n "$reset_color"
1001 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
1002 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx will not work.${reset_color}">&2
1005 if [ -w "$XINITRC" ] ; then
1006 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
1009 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
1014 ## END OF FILE #################################################################
1015 # vim:foldmethod=marker expandtab ai ft=zsh