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 # Latest change: Mit Apr 04 16:26:39 CEST 2007 [mika]
8 ################################################################################
11 # usage: DEBUG=1 grml-x ..... 2>/tmp/grml-x-debug.log
12 if [[ $DEBUG -gt 0 ]]; then
17 # functions and color {{{
18 # use colors only if not booted with nocolor bootoption
19 if ! grep -q nocolor /proc/cmdline ; then
20 autoload colors ; colors
21 [ -r /etc/grml_colors ] && . /etc/grml_colors
24 # some functions like getBootParam
25 if [ -r /etc/grml/script-functions -a -r /etc/grml/sh-lib ] ; then
26 source /etc/grml/script-functions
27 source /etc/grml/sh-lib
29 echo 'Error: sourcing function files failed. Exiting.'
33 check4root &>/dev/null && ROOT='1' || ROOT=''
38 HWINFO='/usr/sbin/hwinfo'
40 [ -n "$XINITRC" ] || XINITRC="$HOME/.xinitrc"
43 HWINFO_TMP="/tmp/hwinfo.$$"
44 MONITORINFO="/tmp/monitorinfo.$$"
45 MOUSEINFO="/tmp/mouse.$$"
47 if [ -r /etc/sysconfig/keyboard ] ; then
48 source /etc/sysconfig/keyboard
54 XCONFIG='/etc/X11/xorg.conf'
55 KEYBOARD="# Driver \"kbd\"
56 # Option \"XkbRules\" \"xfree86\"
57 # Option \"XkbRules\" \"xorg\"
58 # Option \"XkbModel\" \"pc105\"
59 # Option \"XkbLayout\" \"${XKEYBOARD},us\"
60 # Option \"XkbVariant\" \"nodeadkeys\""
63 if [ -d /usr/share/fonts/X11 ] ; then
64 XFONTS=" FontPath \"/usr/share/fonts/X11/misc\"
65 FontPath \"/usr/share/fonts/X11/100dpi/:unscaled\"
66 FontPath \"/usr/share/fonts/X11/75dpi/:unscaled\"
67 FontPath \"/usr/share/fonts/X11/Type1\"
68 FontPath \"/usr/share/fonts/X11/100dpi\"
69 FontPath \"/usr/share/fonts/X11/75dpi\""
71 # /usr/X11R6/lib/X11/fonts exists nearly everywhere, assume
72 # /usr/X11R6/lib/X11/fonts as valid font path only if fonts.dir
74 if [ -r /usr/X11R6/lib/X11/fonts/misc/fonts.dir ] ; then
76 FontPath \"/usr/X11R6/lib/X11/fonts/Type1\"
77 FontPath \"/usr/X11R6/lib/X11/fonts/misc:unscaled\"
78 FontPath \"/usr/X11R6/lib/X11/fonts/misc\"
79 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi:unscaled\"
80 FontPath \"/usr/X11R6/lib/X11/fonts/75dpi\"
81 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi:unscaled\"
82 FontPath \"/usr/X11R6/lib/X11/fonts/100dpi\""
86 # make sure we don't leave any temp files {{{
88 rm -f "$HWINFO_TMP" "$MONITORINFO" "$MOUSEINFO"
89 [ -n "$1" ] && EXIT="$1" || EXIT="1"
90 print "$bg[black]$fg[red]${bold_color}Exiting...${reset_color}">&2
97 # warn if running as user root {{{
98 if [ -n "$ROOT" ] ; then
99 if [ -r /etc/grml_cd ] ; then
100 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run grml-x as user root.${reset_color}"
101 print "$bg[black]$fg[red]${bold_color}Running grml-x as user root is *not* supported!${reset_color}"
102 print "$bg[black]$fg[red]${bold_color}Switch to user grml or run su - grml -c 'grml-x ...' instead.${reset_color}"
105 print "$bg[black]$fg[red]${bold_color}Warning: Please do not run X.org as user root!${reset_color}"
106 print "$bg[black]$fg[red]${bold_color}As soon as you have a working $XCONFIG please use startx instead of grml-x.${reset_color}"
110 fstabuser=$(grep ':x:1000:' /etc/passwd)
111 fstabuser=${fstabuser%%[:]*}
114 # usage information {{{
117 if [[ $1 != '' ]] ; then echo 1>&2 "\n$1" ; fi
118 print "$bg[black]$fg[red]$bold_color"
121 $PROGRAMNAME [-options] windowmanager
127 $PROGRAMNAME -force -nostart fluxbox
128 $PROGRAMNAME -nosynaptics fluxbox
129 $PROGRAMNAME -nosync fluxbox
130 $PROGRAMNAME -noddc wmii
131 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 wmi
132 XINITRC=~/.xinitrc $PROGRAMNAME ion
133 $PROGRAMNAME -display 8 wmii
135 More information on grml-x can be found in the manual page: man grml-x
137 Report bugs, send wishes and feedback to the grml team:
138 http://grml.org/bugs/ - contact (at) grml.org
140 print "${reset_color}"
148 if [ -n "$ROOT" ] ; then
149 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
151 $HWINFO > $HWINFO_TMP
159 sudo $HWINFO --monitor > $MONITORINFO
166 [ -r "$MONITORINFO" ] || monitor # get monitor settings
167 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
168 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
169 if [[ -n $NODDC ]] ; then
170 MODES='Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
171 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
172 MODES='# Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
174 MODES="# Modes $modes"
179 # sync - get hsync/vsync settings {{{
182 [ -r "$MONITORINFO" ] || monitor # get monitor settings
183 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
184 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
185 if [ -z $vsyncval ] ; then
186 vsyncval='50.0 - 60.0'
188 if [ -z $hsyncval ] ; then
189 hsyncval='28.0 - 96.0'
197 sudo $HWINFO --mouse > $MOUSEINFO
199 # SynPS/2 Synaptics TouchPad
200 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
201 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
202 MOUSEDRIVER='synaptics'
203 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
205 Section \"InputDevice\"
207 Identifier \"Synaptics\"
208 Option \"Device\" \"/dev/psaux\"
209 Option \"Protocol\" \"auto-dev\"
210 Option \"LeftEdge\" \"1700\"
211 Option \"RightEdge\" \"5300\"
212 Option \"TopEdge\" \"1700\"
213 Option \"BottomEdge\" \"4200\"
214 Option \"FingerLow\" \"25\"
215 Option \"FingerHigh\" \"30\"
216 Option \"ZAxisMapping\" \"4 5\"
217 Option \"MaxTapTime\" \"180\"
218 Option \"MaxTapMove\" \"220\"
219 Option \"VertScrollDelta\" \"100\"
220 Option \"MinSpeed\" \"0.06\"
221 Option \"MaxSpeed\" \"0.12\"
222 Option \"AccelFactor\" \"0.0010\"
223 # Option \"SHMConfig\" \"on\"
224 # Option \"Repeater\" \"/dev/ps2mouse\"
230 SYNMOUSE='# No synaptics touchpad detected.'
234 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
235 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
236 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
237 MOUSEDRIVER='synaptics'
238 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
240 Section \"InputDevice\"
242 Identifier \"Synaptics\"
243 Option \"Device\" \"/dev/psaux\"
244 Option \"Protocol\" \"auto-dev\"
245 Option \"LeftEdge\" \"120\"
246 Option \"RightEdge\" \"850\"
247 Option \"TopEdge\" \"120\"
248 Option \"BottomEdge\" \"650\"
249 Option \"FingerLow\" \"14\"
250 Option \"FingerHigh\" \"15\"
251 Option \"ZAxisMapping\" \"4 5\"
252 Option \"MaxTapTime\" \"180\"
253 Option \"MaxTapMove\" \"50\"
254 Option \"MaxDoubleTapTime\" \"100\"
255 Option \"VertScrollDelta\" \"20\"
256 Option \"HorizScrollDelta\" \"20\"
257 Option \"MinSpeed\" \"0.3\"
258 Option \"MaxSpeed\" \"2.00\"
259 Option \"AccelFactor\" \"0.030\"
260 Option \"UpDownScrolling\" \"1\"
261 Option \"EmulateMiddleButtonTime\" \"75\"
262 Option \"CircularScrolling\" \"1\"
263 Option \"CircScrollDelta\" \"0.1\"
264 Option \"CircScrollTrigger\" \"8\"
265 # Option \"SHMConfig\" \"on\"
266 # Option \"Repeater\" \"/dev/ps2mouse\"
272 SYNMOUSE='# No alps touchpad detected.'
275 SYNMOUSE='# No synaptics/alps touchpad present.'
279 # USB-PS/2 Optical Mouse
280 if [ -n "$USE_USB" ] ; then
281 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
283 Section \"InputDevice\"
284 Identifier \"USB Mouse\"
286 Option \"Device\" \"/dev/input/mice\"
287 Option \"Protocol\" \"auto\"
288 Option \"ZAxisMapping\" \"4 5\"
289 Option \"Buttons\" \"5\"
290 Option \"SendCoreEvents\" \"true\"
294 USBMOUSE='# InputDevice "USB Mouse" "CorePointer"'
298 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
300 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
301 SERMOUSEDETAIL="Section \"InputDevice\"
302 Identifier \"Serial Mouse\"
304 Option \"Device\" \"/dev/ttyS0\"
305 Option \"Protocol\" \"Microsoft\"
306 Option \"Emulate3Buttons\" \"true\"
307 Option \"Emulate3Timeout\" \"70\"
308 Option \"SendCoreEvents\" \"true\"
312 SERMOUSE='# No serial mouse detected.'
316 # ImExPS/2 Logitech Explorer Mouse
317 # "PS2++ Logitech MX Mouse"
318 if [ -n "$USE_PS2" ] ; then
320 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
321 PS2MOUSEDETAIL="Section \"InputDevice\"
322 Identifier \"PS/2 Mouse\"
324 Option \"Device\" \"/dev/input/mice\"
325 # Option \"Device\" \"/dev/psaux\"
326 Option \"Protocol\" \"PS/2\"
327 Option \"Emulate3Buttons\" \"true\"
328 Option \"Emulate3Timeout\" \"70\"
329 Option \"SendCoreEvents\" \"true\"
333 PS2MOUSE='# InputDevice "PS/2 Mouse" "CorePointer"'
337 EVDEV_MOUSE="# Section \"InputDevice\"
338 # Identifier \"Generic Mouse\"
340 # Option \"Device\" \"/dev/input/mice\"
341 # Option \"Protocol\" \"auto\"
342 # Option \"ZAxisMapping\" \"4 5\"
343 # Option \"Buttons\" \"5\"
344 # Option \"SendCoreEvents\" \"true\"
355 # commandline parsing {{{
358 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
359 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
360 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
361 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
362 fallback=o_fallback usb=o_usb ps2=o_ps2
364 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
368 if [[ "$o_force" != "" ]]; then
372 if [[ "$o_fallback" != "" ]]; then
374 if [ -r /etc/X11/xorg.conf.example ] ; then
375 sudo cp /etc/X11/xorg.conf.example $XCONFIG
376 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
378 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
383 if [[ "$o_nodpms" != "" ]]; then
384 DPMS='Option "DPMS" "false"'
386 DPMS='Option "DPMS" "true"'
389 if [[ "$o_noddc" != "" ]]; then
393 if [[ "$o_vsync" != "" ]]; then
397 if [[ "$o_hsync" != "" ]]; then
401 if [[ "$o_nousb" != "" ]]; then
402 echo 'Warning: option -nousb is deprecated.'>&2
405 if [[ "$o_usb" != "" ]]; then
409 if [[ "$o_nops2" != "" ]]; then
410 echo 'Warning: optino -nops2 is deprecatedË™'>&2
413 if [[ "$o_ps2" != "" ]]; then
417 if [[ "$o_genmouse" != "" ]]; then
421 if [[ "$o_nosynaptics" != "" ]]; then
427 if [[ "$o_nostart" != "" ]]; then
431 DISPLAY=$o_display[2]
433 eval WINDOWMANAGER=\${$#}
435 if [[ "$XKEYBOARD" == de ]] ; then
437 # Option \"XkbVariant\" \"nodeadkeys\""
440 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
441 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
443 sync # get hsync/vsync
445 if [ -z "$o_hsync" ] ; then
446 o_hsync=(-hsync "$hsyncval")
448 HORIZSYNC=" HorizSync $HSYNC"
450 o_hsync=(-hsync "$o_hsync[2]")
452 HORIZSYNC=" HorizSync $HSYNC"
455 if [ -z "$o_vsync" ] ; then
456 o_vsync=(-vsync "$vsyncval")
458 VERTISYNC=" VertRefresh $VSYNC"
460 o_vsync=(-vsync "$o_vsync[2]")
462 VERTISYNC=" VertRefresh $VSYNC"
465 if [[ "$o_nosync" != "" ]]; then
466 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
467 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
470 if [[ "$o_nohsync" != "" ]]; then
471 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
474 if [[ "$o_novref" != "" ]]; then
475 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
482 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
483 [[ $MONITOR != 'ddc' ]] && NODDC=yes
487 if [ -z "$MODULE" ] ; then
488 MODULE="$(getBootParam xmodule 2>/dev/null)"
489 if [ -z "$MODULE" ] ; then
490 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
491 if [ -z "$MODULE" ] ; then
494 # hwinfo >=13.28 reports driver 'intel' instead of i810
495 if [[ "$MODULE" == 'intel' ]] ; then
496 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
503 mouse # get mouse settings
504 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
507 if [ -z $MODE ] ; then
508 B_MODE="$(getBootParam xmode 2>/dev/null)"
509 if [ -n "$B_MODE" ] ; then
510 MODES="Modes \"$B_MODE\""
513 if [ -z "$MODES" ] ; then
514 mode # get available modes
517 MODES="Modes \"$MODE\""
521 print "$fg[green]done$reset_color"
522 print "$bg[black]$fg[white]$bold_color"
523 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
524 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
525 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
526 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
527 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
528 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
529 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
530 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
531 print "${reset_color}"
537 # check for requirements {{{
540 if ! [ -x $(which hwinfo) ] ; then
541 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
542 Note: run 'apt-get install hwinfo' on systems running debian.
543 Exiting.${reset_color}"
547 if ! [[ -d /sys ]] ; then
548 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
549 You may want to add the following line to your /etc/fstab:
551 sysfs /sys sysfs defaults 0 0
553 or just run 'mount /sys'. Exiting.${reset_color}"
563 ################################################################################
565 # Purpose: config file for xserver - generated by grml-x
566 # Bug-Reports: see http://grml.org/bugs/
567 # Latest change: ${DATE}
569 # /usr/share/doc/xserver-xorg/ and
570 # http://wiki.x.org/wiki/Home and
571 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
572 # Refer to the xorg.conf man page and to
573 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
574 # for details about the format of this file.
576 # If you would like this file to be automatically reconfigured by debian,
577 # run the following command:
578 # sudo dpkg-reconfigure -phigh xserver-xorg
579 ################################################################################
581 Section "ServerLayout"
582 Identifier "XServer Configured"
583 Screen 0 "Screen0" 0 0
584 # InputDevice "Keyboard0" "CoreKeyboard"
585 # InputDevice "Generic Mouse" "CorePointer"
589 Section "ServerFlags"
590 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
591 Option "DontVTSwitch" "false" # allow switching between virtual terminal
592 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
593 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
597 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
599 # FontPath "/usr/share/fonts/ttf/western"
600 # FontPath "/usr/share/fonts/ttf/decoratives"
601 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
602 FontPath "/usr/share/fonts/latex-ttf-fonts"
603 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
606 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
608 Load "dbe" # double buffer extension
609 Load "dri" # direct rendering
610 Load "glx" # 3D layer
611 Load "type1" # font module
612 Load "freetype" # font rendering
613 Load "extmod" # some commonly used server extensions (e.g. shape extension)
614 Load "record" # recording extension
615 Load "evdev" # generic input handling driver on Linux
616 # Load "vbe" # Vesa BIOS Extension
617 # Load "ddc" # ddc probing of monitor
618 # Load "bitmap" # bitmap fonts
619 # Load "GLcore" # render OpenGL in software
620 # Load "i2c" # I2C bus
621 # Load "int10" # initialize graphics cards via int10 call to the BIOS
622 # Load "speedo" # font module
623 # Load "v4l" # Video for Linux
624 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
625 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
626 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
627 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
628 # xf8_16bpp xf8_32bpp xtrap
631 # If you'd like to switch the positions of your capslock and control keys, use:
632 # Option "XkbOptions" "ctrl:swapcaps"
633 # Or if you just want both to be control, use:
634 # Option "XkbOptions" "ctrl:nocaps"
635 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
636 # Section "InputDevice"
637 # Identifier "Keyboard0"
638 # Option "CoreKeyboard"
640 # # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
643 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
650 Identifier "Monitor0"
651 # ModelName "Old Monitor (no DDC)"
653 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
654 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
656 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
657 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
659 # Need more information?
660 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
661 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
665 ### Available Driver options are:
666 ## sw_cursor is needed for some ati and radeon cards
675 # Option "RenderAccel" "true"
676 # Option "AllowGLXWithComposite" "true"
678 # The following line is auto-generated by grml-x
682 ## Workaround for drivers (for example radeon) which might send output to wrong device:
683 # Option "MonitorLayout" "LVDS, AUTO"
684 # Option "MonitorLayout" "LVDS, CRT"
685 # Option "MonitorLayout" "NONE, STV"
686 # Option "MonitorLayout" "LVDS"
726 # Make sure you have the relevant Debian packages on your system
727 # to be able to use DRI (libgl1-mesa-dri for example)
732 #Section "Extensions"
733 # Option "Composite" "Enable"
736 ## END OF FILE #################################################################
743 XCONFTMP="/tmp/xconfig.$$"
745 # we do not want to have two CorePointers, deactivate one therefore
746 if grep -Eq '^[[:space:]]+InputDevice[ ]+"USB Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
747 if grep -Eq '^[[:space:]]+InputDevice[ ]+"PS/2 Mouse"[ ]+"CorePointer"' $XCONFTMP ; then
748 sed -i 's|InputDevice.*PS/2.*CorePointer|# & # deactivated to avoid two CorePointers|' $XCONFTMP
751 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
752 sudo mv $XCONFTMP $XCONFIG
753 sudo chown root.root $XCONFIG
754 sudo chmod 644 $XCONFIG
761 if [[ ! -f $XCONFIG ]] ; then
762 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
763 writeit && print "$fg[green]done$reset_color"
765 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
766 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
767 Use the force-option (-force) to force creation.
771 if [[ -n "$FORCE" ]] ; then
772 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
773 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
774 writeit && print "$fg[green]done$reset_color"
783 if [ -z "$NOSTART" ] ; then
785 if [ -x /etc/init.d/xorg-common ] ; then
786 sudo /etc/init.d/xorg-common start
788 if [ -x /etc/init.d/xfree86-common ] ; then
789 sudo /etc/init.d/xfree86-common start
793 if [ -z "$DISPLAY" ] ; then
794 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
795 startx $XINITRC -- $XOPTS
797 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
798 startx $XINITRC -- :$DISPLAY $XOPTS
801 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
811 if [ -z "$ROOT" ] ; then
812 if [[ $(tty) == /dev/pts/* ]] ; then
813 print "It seems you are running $PROGRAMNAME from inside GNU screen.
814 Notice that this might fail if running as user grml!
815 Please exit screen and try to run $PROGRAMNAME again."
818 print "Run the following commands for getting information on your hardware:
820 discover -v --data-path=xfree86/server/device/driver display
821 xdebconfigurator -c -d -i -x
822 get-edid | parse-edid
824 Do you want to go the debian way of life? Run:
825 apt-get install x-window-system-core read-edid mdetect hwinfo xdebconfigurator
826 dpkg-reconfigure x-window-system-core (or xserver-xorg depending on your system)
828 Problems with the module used for X? Try to load another one or
829 fall back to module vesa:
830 $PROGRAMNAME -module radeon ...
831 $PROGRAMNAME -module vesa ...
833 Do you want to deactivate a present synaptics touchpad? Run:
834 $PROGRAMNAME -nosynaptics ...
836 Your monitor is very old and/or does not support DDC-probing?
837 $PROGRAMNAME -noddc ...
839 Do you want to create a x configuration file but do not start X?
840 $PROGRAMNAME -nostart ...
842 Monitor frequency too high or too low? Just specify hsync/vsync manually:
843 $PROGRAMNAME -hsync 30-65 ...
844 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
846 Want to adjust the resolution? Use the mode-switch:
847 $PROGRAMNAME -mode 1024x768 ...
848 $PROGRAMNAME -mode '1280x1024 1024x768' ...
850 Problems? Use vesa with resolution 1024x768:
851 $PROGRAMNAME -module vesa -mode 1024x768 ...
853 Still problems with X? Use the fallback option:
854 $PROGRAMNAME -fallback ...
856 To adjust resolution while running X execute:
859 More information on grml-x can be found in the manual page: man grml-x
861 Report bugs, send wishes and feedback to the grml team:
862 http://grml.org/bugs/ - contact (at) grml.org
864 print -n "$reset_color"
880 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
881 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx won' work.${reset_color}">&2
884 if [ -w "$XINITRC" ] ; then
885 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
888 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
893 ## END OF FILE #################################################################
894 # vim:foldmethod=marker