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: Mon Mär 26 22:19:37 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 -nousb fluxbox
132 $PROGRAMNAME -module radeon -mode 1024x768 -vsync 60 wmi
133 XINITRC=~/.xinitrc $PROGRAMNAME ion
134 $PROGRAMNAME -display 8 wmii
136 More information on grml-x can be found in the manual page: man grml-x
138 Report bugs, send wishes and feedback to the grml team:
139 http://grml.org/bugs/ - contact (at) grml.org
141 print "${reset_color}"
149 if [ -n "$ROOT" ] ; then
150 su - $fstabuser -c "$HWINFO > $HWINFO_TMP"
152 $HWINFO > $HWINFO_TMP
160 sudo $HWINFO --monitor > $MONITORINFO
167 [ -r "$MONITORINFO" ] || monitor # get monitor settings
168 modes=$(perl -e 'while (<STDIN>) {if (/ Resolution:/) { s/.*\s+(\d+x\d+).*/$1/; print} }' < $MONITORINFO |
169 sort -nur | perl -ne 's/\s+/ /; s/(\d+x\d+)/"$1"/; print')
170 if [[ -n $NODDC ]] ; then
171 MODES='Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
172 elif [[ "$modes" == "\"1024x768\" " || -z $modes ]] ; then
173 MODES='# Modes "1024x768" "800x600" "640x480" "1600x1200" "1280x1024" "1280x960"'
175 MODES="# Modes $modes"
180 # sync - get hsync/vsync settings {{{
183 [ -r "$MONITORINFO" ] || monitor # get monitor settings
184 vsyncval=$(awk '/Vert. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
185 hsyncval=$(awk '/Hor. Sync Range:/{print $4}' $MONITORINFO | sed 's/-/.0 - / ; s/$/.0/' | head -1)
186 if [ -z $vsyncval ] ; then
187 vsyncval='50.0 - 60.0'
189 if [ -z $hsyncval ] ; then
190 hsyncval='28.0 - 96.0'
198 sudo $HWINFO --mouse > $MOUSEINFO
200 # SynPS/2 Synaptics TouchPad
201 if grep -q 'Device:.*Synaptics' "$MOUSEINFO" ; then
202 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
203 MOUSEDRIVER='synaptics'
204 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
206 Section \"InputDevice\"
208 Identifier \"Synaptics\"
209 Option \"Device\" \"/dev/psaux\"
210 Option \"Protocol\" \"auto-dev\"
211 Option \"LeftEdge\" \"1700\"
212 Option \"RightEdge\" \"5300\"
213 Option \"TopEdge\" \"1700\"
214 Option \"BottomEdge\" \"4200\"
215 Option \"FingerLow\" \"25\"
216 Option \"FingerHigh\" \"30\"
217 Option \"ZAxisMapping\" \"4 5\"
218 Option \"MaxTapTime\" \"180\"
219 Option \"MaxTapMove\" \"220\"
220 Option \"VertScrollDelta\" \"100\"
221 Option \"MinSpeed\" \"0.06\"
222 Option \"MaxSpeed\" \"0.12\"
223 Option \"AccelFactor\" \"0.0010\"
224 # Option \"SHMConfig\" \"on\"
225 # Option \"Repeater\" \"/dev/ps2mouse\"
231 SYNMOUSE='# No synaptics touchpad detected.'
235 # AlpsPS/2 ALPS TouchPad (with Synapticsdriver)
236 if grep -q 'Device:.*ALPS' "$MOUSEINFO" ; then
237 if [[ "$SYNAPTICS" == "yes" ]] ; then # check for '-nosynaptics'-option
238 MOUSEDRIVER='synaptics'
239 # SYNMOUSE='InputDevice "Synaptics" "CorePointer"'
240 SYNMOUSE='InputDevice "Synaptics" "AlwaysCore"'
242 Section \"InputDevice\"
244 Identifier \"Synaptics\"
245 Option \"Device\" \"/dev/psaux\"
246 Option \"Protocol\" \"auto-dev\"
247 Option \"LeftEdge\" \"120\"
248 Option \"RightEdge\" \"850\"
249 Option \"TopEdge\" \"120\"
250 Option \"BottomEdge\" \"650\"
251 Option \"FingerLow\" \"14\"
252 Option \"FingerHigh\" \"15\"
253 Option \"ZAxisMapping\" \"4 5\"
254 Option \"MaxTapTime\" \"180\"
255 Option \"MaxTapMove\" \"50\"
256 Option \"MaxDoubleTapTime\" \"100\"
257 Option \"VertScrollDelta\" \"20\"
258 Option \"HorizScrollDelta\" \"20\"
259 Option \"MinSpeed\" \"0.3\"
260 Option \"MaxSpeed\" \"2.00\"
261 Option \"AccelFactor\" \"0.030\"
262 Option \"UpDownScrolling\" \"1\"
263 Option \"EmulateMiddleButtonTime\" \"75\"
264 Option \"CircularScrolling\" \"1\"
265 Option \"CircScrollDelta\" \"0.1\"
266 Option \"CircScrollTrigger\" \"8\"
267 # Option \"SHMConfig\" \"on\"
268 # Option \"Repeater\" \"/dev/ps2mouse\"
274 SYNMOUSE='# No alps touchpad detected.'
277 SYNMOUSE='# No alps touchpad present.'
281 # USB-PS/2 Optical Mouse
282 if ! [[ -n $NOUSB ]] ; then
284 USBMOUSE='InputDevice "USB Mouse" "CorePointer"'
286 Section \"InputDevice\"
287 Identifier \"USB Mouse\"
289 Option \"Device\" \"/dev/input/mice\"
290 Option \"Protocol\" \"auto\"
291 Option \"ZAxisMapping\" \"4 5\"
292 Option \"Buttons\" \"5\"
293 Option \"SendCoreEvents\" \"true\"
297 USBMOUSE='# Deactivated USB Mouse as requested.'
300 if grep -q 'Device:.*Serial' "$MOUSEINFO" ; then
302 SERMOUSE='InputDevice "Serial Mouse" "CorePointer"'
304 Section \"InputDevice\"
305 Identifier \"Serial Mouse\"
307 Option \"Device\" \"/dev/ttyS0\"
308 Option \"Protocol\" \"Microsoft\"
309 Option \"Emulate3Buttons\" \"true\"
310 Option \"Emulate3Timeout\" \"70\"
311 Option \"SendCoreEvents\" \"true\"
315 SERMOUSE='# No serial mouse detected.'
318 # ImExPS/2 Logitech Explorer Mouse
319 # "PS2++ Logitech MX Mouse"
320 if ! [[ -n $NOPS2 ]] ; then
321 if grep -qE 'Device:.*PS.?2' "$MOUSEINFO" ; then
323 PS2MOUSE='InputDevice "PS/2 Mouse" "CorePointer"'
325 Section \"InputDevice\"
326 Identifier \"PS/2 Mouse\"
328 Option \"Device\" \"/dev/input/mice\"
329 # Option \"Device\" \"/dev/psaux\"
330 Option \"Protocol\" \"PS/2\"
331 Option \"Emulate3Buttons\" \"true\"
332 Option \"Emulate3Timeout\" \"70\"
333 Option \"SendCoreEvents\" \"true\"
337 PS2MOUSE='# No PS/2 mouse detected.'
341 PS2MOUSE='# Deactivated PS/2 Mouse as requested.'
344 if [[ -n $GENERICMOUSE ]] ; then
346 GENERICMOUSE='InputDevice "Generic Mouse" "CorePointer"'
348 Section \"InputDevice\"
349 Identifier \"Generic Mouse\"
351 Option \"Device\" \"/dev/input/mice\"
352 Option \"Protocol\" \"auto\"
353 Option \"Buttons\" \"5\"
354 Option \"ZAxisMapping\" \"4 5\"
358 GENERICMOUSE='# No generic mouse configured.'
369 # commandline parsing {{{
372 zparseopts -K -- module:=o_module help=o_help noddc=o_noddc nosync=o_nosync \
373 vsync:=o_vsync hsync:=o_hsync mode:=o_mode force=o_force display:=o_display \
374 nostart=o_nostart nodpms=o_nodpms nosynaptics=o_nosynaptics nousb=o_nousb \
375 nops2=o_nops2 genmouse=o_genmouse novref=o_novref nohsync=o_nohsync \
378 if [[ $# == 0 || "$o_help" != "" || "$1" == '-h' || "$1" == '--help' ]]; then
382 if [[ "$o_force" != "" ]]; then
386 if [[ "$o_fallback" != "" ]]; then
388 if [ -r /etc/X11/xorg.conf.example ] ; then
389 sudo cp /etc/X11/xorg.conf.example $XCONFIG
390 print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option."
392 echo 'Error: /etc/X11/xorg.conf.example not readable, exiting.'
397 if [[ "$o_nodpms" != "" ]]; then
398 DPMS='Option "DPMS" "false"'
400 DPMS='Option "DPMS" "true"'
403 if [[ "$o_noddc" != "" ]]; then
407 if [[ "$o_vsync" != "" ]]; then
411 if [[ "$o_hsync" != "" ]]; then
415 if [[ "$o_nousb" != "" ]]; then
419 if [[ "$o_nops2" != "" ]]; then
423 if [[ "$o_genmouse" != "" ]]; then
427 if [[ "$o_nosynaptics" != "" ]]; then
433 if [[ "$o_nostart" != "" ]]; then
437 DISPLAY=$o_display[2]
439 eval WINDOWMANAGER=\${$#}
441 if [[ "$XKEYBOARD" == de ]] ; then
443 Option \"XkbVariant\" \"nodeadkeys\""
446 if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then
447 print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]"
449 sync # get hsync/vsync
451 if [ -z "$o_hsync" ] ; then
452 o_hsync=(-hsync "$hsyncval")
454 HORIZSYNC=" HorizSync $HSYNC"
456 o_hsync=(-hsync "$o_hsync[2]")
458 HORIZSYNC=" HorizSync $HSYNC"
461 if [ -z "$o_vsync" ] ; then
462 o_vsync=(-vsync "$vsyncval")
464 VERTISYNC=" VertRefresh $VSYNC"
466 o_vsync=(-vsync "$o_vsync[2]")
468 VERTISYNC=" VertRefresh $VSYNC"
471 if [[ "$o_nosync" != "" ]]; then
472 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nosync option of grml-x"
473 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -nosync option of grml-x"
476 if [[ "$o_nohsync" != "" ]]; then
477 HORIZSYNC="# HorizSync 28.0 - 96.0 # deactivated via -nohsync option of grml-x"
480 if [[ "$o_novref" != "" ]]; then
481 VERTISYNC="# VertRefresh 50.0 - 60.0 # deactivated via -novref option of grml-x"
488 MONITOR=$(awk '/monitor.1:/{print $3}' $HWINFO_TMP)
489 [[ $MONITOR != 'ddc' ]] && NODDC=yes
493 if [ -z "$MODULE" ] ; then
494 MODULE="$(getBootParam xmodule 2>/dev/null)"
495 if [ -z "$MODULE" ] ; then
496 MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}')
497 if [ -z "$MODULE" ] ; then
500 # hwinfo >=13.28 reports driver 'intel' instead of i810
501 if [[ "$MODULE" == 'intel' ]] ; then
502 [ -r /usr/lib/xorg/modules/drivers/intel_drv.so ] || MODULE='i810'
509 mouse # get mouse settings
510 VGA=$(lspci | grep VGA | sed 's/.*compatible controller: //' | head -1)
513 if [ -z $MODE ] ; then
514 B_MODE="$(getBootParam xmode 2>/dev/null)"
515 if [ -n "$B_MODE" ] ; then
516 MODES="Modes \"$B_MODE\""
519 if [ -z "$MODES" ] ; then
520 mode # get available modes
523 MODES="Modes \"$MODE\""
527 print "$fg[green]done$reset_color"
528 print "$bg[black]$fg[white]$bold_color"
529 print "$fg[green]Specified windowmanager is $fg[yellow]$WINDOWMANAGER"
530 print "$fg[green]Video is $fg[yellow]$VGA$fg[green] using $bg[black]$fg[yellow]${XSERVER}$fg[cyan](${MODULE})$fg[green] Server"
531 [[ -z $HSYNC ]] && [[ -z $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR"
532 [[ -z $HSYNC ]] && [[ -n $VSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], VSYNC: $fg[yellow]$VSYNC"
533 [[ -z $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC"
534 [[ -n $VSYNC ]] && [[ -n $HSYNC ]] && print "$fg[green]Monitor is $fg[yellow]$MONITOR$fg[green], HSYNC: $fg[yellow]$HSYNC $fg[green]VSYNC: $fg[yellow]$VSYNC"
535 [[ -n $modes ]] && print "$fg[green]Using default X.org modes."
536 [[ -z $modes ]] && print "$fg[green]Using Mode: $fg[yellow]$MODE"
537 print "${reset_color}"
543 # check for requirements {{{
546 if ! [ -x $(which hwinfo) ] ; then
547 print "$bg[black]$fg[red]${bold_color}Error: hwinfo not found in path.${reset_color}
548 Note: run 'apt-get install hwinfo' on systems running debian.
549 Exiting.${reset_color}"
553 if ! [[ -d /sys ]] ; then
554 print "$bg[black]$fg[red]${bold_color}Error: mounted /sys required (for hwinfo).${reset_color}
555 You may want to add the following line to your /etc/fstab:
557 sysfs /sys sysfs defaults 0 0
559 or just run 'mount /sys'. Exiting.${reset_color}"
569 ################################################################################
571 # Purpose: config file for xserver - generated by grml-x
572 # Bug-Reports: see http://grml.org/bugs/
573 # Latest change: ${DATE}
575 # /usr/share/doc/xserver-xorg/ and
576 # http://wiki.x.org/wiki/Home and
577 # http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
578 # Refer to the xorg.conf man page and to
579 # http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
580 # for details about the format of this file.
582 # If you would like this file to be automatically reconfigured by debian,
583 # run the following command:
584 # sudo dpkg-reconfigure -phigh xserver-xorg
585 ################################################################################
587 Section "ServerLayout"
588 Identifier "XServer Configured"
589 Screen 0 "Screen0" 0 0
590 InputDevice "Keyboard0" "CoreKeyboard"
594 Section "ServerFlags"
595 Option "AllowMouseOpenFail" "true" # allows the server to start up even if the mouse does not work
596 Option "DontVTSwitch" "false" # allow switching between virtual terminal
597 # Option "DontZap" "true" # disable <Crtl><Alt><BS> (server abort)
598 # Option "DontZoom" "true" # disable <Crtl><Alt><KP_+>/<KP_-> (resolution switching)
602 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/fonts.html
604 # FontPath "/usr/share/fonts/ttf/western"
605 # FontPath "/usr/share/fonts/ttf/decoratives"
606 FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
607 FontPath "/usr/share/fonts/latex-ttf-fonts"
608 FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
611 # Modules - see /usr/X11R6/lib/modules/fonts and /usr/X11R6/lib/modules/extensions
613 Load "dbe" # double buffer extension
614 Load "dri" # direct rendering
615 Load "glx" # 3D layer
616 Load "type1" # font module
617 Load "freetype" # font rendering
618 Load "extmod" # some commonly used server extensions (e.g. shape extension)
619 Load "record" # recording extension
620 # Load "vbe" # Vesa BIOS Extension
621 # Load "ddc" # ddc probing of monitor
622 # Load "bitmap" # bitmap fonts
623 # Load "GLcore" # render OpenGL in software
624 # Load "i2c" # I2C bus
625 # Load "int10" # initialize graphics cards via int10 call to the BIOS
626 # Load "speedo" # font module
627 # Load "v4l" # Video for Linux
628 # Load "evdev" # generic input handling driver on Linux
629 # Valid entries - see /usr/lib/xorg/modules/[extensions/]
630 # afb bitmap cfb cfb16 cfb24 cfb32 cw damage dbe ddc dri drm extmod fb
631 # fbdevhw freetype GLcore glx i2c int10 int10 layer mfb pcidata rac ramdac
632 # record scanpci shadow shadowfb type1 vbe vgahw xaa xf1bpp xf24_32bpp xf4bpp
633 # xf8_16bpp xf8_32bpp xtrap
636 # If you'd like to switch the positions of your capslock and control keys, use:
637 # Option "XkbOptions" "ctrl:swapcaps"
638 # Or if you just want both to be control, use:
639 # Option "XkbOptions" "ctrl:nocaps"
640 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/XKB-Config.html
641 Section "InputDevice"
642 Identifier "Keyboard0"
643 Option "CoreKeyboard"
645 # Option "XkbOptions" "ctrl:swapcaps,grp:alt_shift_toggle,grp_led:scroll,compose:menu"
648 # More information: http://ftp.x.org/pub/X11R7.0/doc/html/mouse.html
655 Identifier "Monitor0"
656 # ModelName "Old Monitor (no DDC)"
658 # HorizSync 28.0 - 78.0 # Warning: This may fry very old Monitors
659 # HorizSync 28.0 - 96.0 # Warning: This may fry old Monitors
661 # VertRefresh 50.0 - 76.0 # Very conservative. May flicker.
662 # VertRefresh 50.0 - 60.0 # Extreme conservative. Will flicker. TFT default.
664 # Need more information?
665 # http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
666 # http://en.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
670 ### Available Driver options are:
671 ## sw_cursor is needed for some ati and radeon cards
680 # Option "RenderAccel" "true"
681 # Option "AllowGLXWithComposite" "true"
683 # The following line is auto-generated by grml-x
687 ## Workaround for drivers (for example radeon) which might send output to wrong device:
688 # Option "MonitorLayout" "LVDS, AUTO"
689 # Option "MonitorLayout" "LVDS, CRT"
690 # Option "MonitorLayout" "NONE, STV"
691 # Option "MonitorLayout" "LVDS"
735 #Section "Extensions"
736 # Option "Composite" "Enable"
739 ## END OF FILE #################################################################
746 XCONFTMP="/tmp/xconfig.$$"
748 [ -f $XCONFIG ] && sudo mv -f $XCONFIG $XCONFIG.old
749 sudo mv $XCONFTMP $XCONFIG
750 sudo chown root.root $XCONFIG
751 sudo chmod 644 $XCONFIG
758 if [[ ! -f $XCONFIG ]] ; then
759 print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]"
760 writeit && print "$fg[green]done$reset_color"
762 if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then
763 print "$bold_color$fg[blue]Notice: $XCONFIG exists already.
764 Use the force-option (-force) to force creation.
768 if [[ -n "$FORCE" ]] ; then
769 print "$bold_color$fg[blue]Force-switch or manual option(s) detected:"
770 print -n "\-> Moving eventual existing $XCONFIG to ${XCONFIG}.old: $fg[red]"
771 writeit && print "$fg[green]done$reset_color"
780 if [ -z "$NOSTART" ] ; then
782 if [ -x /etc/init.d/xorg-common ] ; then
783 sudo /etc/init.d/xorg-common start
785 if [ -x /etc/init.d/xfree86-common ] ; then
786 sudo /etc/init.d/xfree86-common start
790 if [ -z "$DISPLAY" ] ; then
791 print "$bold_color$fg[green]Now trying to run startx.$reset_color"
792 startx $XINITRC -- $XOPTS
794 print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color"
795 startx $XINITRC -- :$DISPLAY $XOPTS
798 print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color"
808 if [ -z "$ROOT" ] ; then
809 if [[ $(tty) == /dev/pts/* ]] ; then
810 print "It seems you are running $PROGRAMNAME from inside GNU screen.
811 Notice that this might fail if running as user grml!
812 Please exit screen and try to run $PROGRAMNAME again."
815 print "Run the following commands for getting information on your hardware:
817 discover -v --data-path=xfree86/server/device/driver display
818 xdebconfigurator -c -d -i -x
819 get-edid | parse-edid
821 Do you want to go the debian way of life? Run:
822 apt-get install x-window-system-core read-edid mdetect hwinfo xdebconfigurator
823 dpkg-reconfigure x-window-system-core (or xserver-xorg depending on your system)
825 Problems with the module used for X? Try to load another one or
826 fall back to module vesa:
827 $PROGRAMNAME -module radeon ...
828 $PROGRAMNAME -module vesa ...
830 Do you want to deactivate a present synaptics touchpad? Run:
831 $PROGRAMNAME -nosynaptics ...
833 Your monitor is very old and/or does not support DDC-probing?
834 $PROGRAMNAME -noddc ...
836 Do you want to create a x configuration file but do not start X?
837 $PROGRAMNAME -nostart ...
839 Monitor frequency too high or too low? Just specify hsync/vsync manually:
840 $PROGRAMNAME -hsync 30-65 ...
841 $PROGRAMNAME -hsync 30-65 -vsync 50-60 ...
843 Want to adjust the resolution? Use the mode-switch:
844 $PROGRAMNAME -mode 1024x768 ...
845 $PROGRAMNAME -mode '1280x1024 1024x768' ...
847 Problems? Use vesa with resolution 1024x768:
848 $PROGRAMNAME -module vesa -mode 1024x768 ...
850 Still problems with X? Use the fallback option:
851 $PROGRAMNAME -fallback ...
853 To adjust resolution while running X execute:
856 More information on grml-x can be found in the manual page: man grml-x
858 Report bugs, send wishes and feedback to the grml team:
859 http://grml.org/bugs/ - contact (at) grml.org
861 print -n "$reset_color"
877 if ! [ -x "$(which $WINDOWMANAGER)" ] ; then
878 print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx won' work.${reset_color}">&2
881 if [ -w "$XINITRC" ] ; then
882 sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC
885 echo -e "#!/bin/sh\n exec $WINDOWMANAGER" >> $XINITRC
890 ## END OF FILE #################################################################
891 # vim:foldmethod=marker