aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xserver
blob: cea733e9fb4eb21189f034bd140ba349ca1e2efa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#

# note xinit needs full server path
XSERVER=/usr/bin/Xipaq
if [ -f /usr/bin/Xfbdev ]; then
  XSERVER=/usr/bin/Xfbdev
fi
if [ -f /usr/bin/Xepson ]; then
  XSERVER=/usr/bin/Xepson
fi
if [ -f /usr/bin/Xorg ]; then
  XSERVER=/usr/bin/Xorg
fi
if [ -f /usr/bin/Xomap ]; then
  XSERVER=/usr/bin/Xomap
fi

. /etc/profile

ARGS=" -br -pn"

if [ "$XSERVER" != "/usr/bin/Xorg" ]; then

        . /etc/formfactor/config

        ARGS="$ARGS -keybd keyboard"

        # use usb mouse if present
        if [ -z "$TSLIB_TSDEVICE" ] && [ -e /dev/input/mice ]; then
          ARGS="$ARGS -mouse mouse,/dev/input/mice"
        fi

        # kdrive 1.4 onwards needs -mouse args
        if [ -n "$TSLIB_TSDEVICE" ]; then
          ARGS="$ARGS -mouse tslib"
        fi

        ARGS="$ARGS -screen ${DISPLAY_WIDTH_PIXELS}x${DISPLAY_HEIGHT_PIXELS}@${DISPLAY_ORIENTATION}x${DISPLAY_BPP}"

        if [ ! -z "$DISPLAY_DPI" ]; then
                ARGS="$ARGS -dpi $DISPLAY_DPI"
        fi

        if [ ! -z "$DISPLAY_SUBPIXEL_ORDER" ]; then
                ARGS="$ARGS -rgba $DISPLAY_SUBPIXEL_ORDER"
        fi

fi

DISPLAY=':0'

exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*