source: packages/Xorg/xserver/xglamo/files/x.init @ 14479

Last change on this file since 14479 was 14479, checked in by mirko, 7 years ago

adding poc implementation for autostarting x11 applications

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2006 OpenWrt.org
3START=99
4
5ARGS=""
6
7screen() {
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
15desktop() {
16        local cfg="$1"
17        config_get autostart $cfg autostart
18        [ -n "$autostart" ] && eval $autostart &
19        config_get fdo_compliance $cfg fdo_compliance
20        [ -n "`echo \"$fdo_compliance\" 2> /dev/null | grep autostart`" ] && exit # in case the environment provides its own functionality to do the autostart stuff exit here
21}
22
23start() {
24        export DISPLAY=":0"
25        config_load x11
26        config_foreach screen screen
27        TSLIB_TSDEVICE="/dev/event1" Xglamo $ARGS &
28        sleep 1 # give the xserver some time get initialized
29        config_foreach desktop desktop
30        test -d /etc/xdg/autostart || exit
31        sleep 1 # give the first x11 application some time to get present - afterwars we'll start the x11 autostart applications
32        for elem in `ls /etc/xdg/autostart/`; do
33                if grep "^Hidden=true" "/etc/xdg/autostart/$elem" > /dev/null; then
34                        continue
35                fi
36                exec=`grep "^Exec=" "/etc/xdg/autostart/$elem"`
37                eval ${exec#*=} &
38        done
39}
Note: See TracBrowser for help on using the repository browser.