2008-11-16 19:31:42 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
START=99
|
|
|
|
|
|
|
|
ARGS=""
|
|
|
|
|
|
|
|
screen() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get resolution $cfg resolution
|
|
|
|
config_get dpi $cfg dpi
|
|
|
|
[ -n "$resolution" ] && ARGS="$ARGS -screen $resolution"
|
|
|
|
[ -n "$dpi" ] && ARGS="$ARGS -dpi $dpi"
|
|
|
|
}
|
|
|
|
|
|
|
|
graphic() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get device $cfg device
|
|
|
|
[ -n "$device" ] && ARGS="$ARGS -fb $device"
|
|
|
|
}
|
|
|
|
|
|
|
|
input() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get device $cfg device
|
|
|
|
config_get driver $cfg driver
|
|
|
|
#[ -n "$device" ] || return 0
|
|
|
|
[ -n "$driver" ] || return 0
|
|
|
|
ARGS="$ARGS -$cfg $driver,,device=$device"
|
|
|
|
}
|
|
|
|
|
2009-01-21 21:02:54 +00:00
|
|
|
desktop() {
|
2008-11-16 19:31:42 +00:00
|
|
|
local cfg="$1"
|
2009-01-21 21:02:54 +00:00
|
|
|
config_get autostart $cfg autostart
|
|
|
|
[ -n "$autostart" ] && eval $autostart &
|
2008-11-16 19:31:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
2009-01-21 21:02:54 +00:00
|
|
|
export DISPLAY=":0"
|
2008-11-16 19:31:42 +00:00
|
|
|
config_load x11
|
|
|
|
config_foreach screen screen
|
|
|
|
config_foreach graphic graphic
|
|
|
|
config_foreach input input
|
|
|
|
X $ARGS &
|
2009-01-21 21:02:54 +00:00
|
|
|
config_foreach desktop desktop
|
|
|
|
#test -d /etc/xdg/autostart || exit
|
|
|
|
#for elem in `ls /etc/xdg/autostart/`; do
|
|
|
|
# exec=`grep "^Exec=" "/etc/xdg/autostart/$elem"`
|
|
|
|
# eval ${exec#*=} &
|
|
|
|
#done
|
2008-11-16 19:31:42 +00:00
|
|
|
}
|