some bugfixes and aesthetical changes regarding xserver
[openwrt/svn-archive/archive.git] / Xorg / xserver / xorg-xserver / files / x.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3 START=99
4
5 ARGS=""
6
7 screen() {
8 local cfg="$1"
9 config_get resolution $cfg resolution
10 config_get dpi $cfg dpi
11 [ -n "$resolution" ] && ARGS="$ARGS -screen $resolution"
12 [ -n "$dpi" ] && ARGS="$ARGS -dpi $dpi"
13 }
14
15 graphic() {
16 local cfg="$1"
17 config_get device $cfg device
18 [ -n "$device" ] && ARGS="$ARGS -fb $device"
19 }
20
21 input() {
22 local cfg="$1"
23 config_get device $cfg device
24 config_get driver $cfg driver
25 #[ -n "$device" ] || return 0
26 [ -n "$driver" ] || return 0
27 ARGS="$ARGS -$cfg $driver,,device=$device"
28 }
29
30 start_with_x() {
31 local cfg="$1"
32 config_get start $cfg start
33 [ -n "$start" ] && START="$START $start &"
34 }
35
36 start() {
37 config_load x11
38 config_foreach screen screen
39 config_foreach graphic graphic
40 config_foreach input input
41 #config_foreach start_with_x start
42 X $ARGS &
43 #eval $START # not used yet, because the buildroot lacks of the functionality of editing uci-values while building a package
44 DISPLAY=":0" WM & # workaround
45 }