Hello All !
As this is my first posting here, I'd like to thank all the people
who made it possible to run Linux on iPAQ. This was the _one
and only_ reason, why I bought one after reading an article
about Embedded Linux in german Linux-Magazin.
On Tuesday, 12. June 2001 15:11, jaap.hogenberg_at_nl.abnamro.com wrote:
>_I've made a copy of the script "/etc/init.d/x" called "xland" in which I
[...]
>_(The "stop" part is still the same , so I ripped that out of
>_the xland script to save space)
Yes, space is my problem, too (have no expansion card)
so I played around a bit as i had the problem too that X stopped
but not started again when script was called locally...
but until now the following works for me (using fam.4 stable with
bash installed and sh linked to bash)
I did a small change to the x startscript...
as /etc/init.d/x sources /etc/profile I put a new variable to profile...
---snip---
export SCREEN_DEF=240x320
---snap---
this comes after the "exports" section in x script
---snip---
[...]
# check for parameter, else set to default
if [ "$2" != "" ]; then
export SCREEN_NOW=$2
else
export SCREEN_NOW=$SCREEN_DEF
fi
case $1 in
'start')
echo "Starting X..."
cd $HOME
Xfbdev -screen $SCREEN_NOW &
bl 1 1 0
[...]
---snap---
when x is started by runlevel, or you do "/etc/init.d/x start"
the default defined in /etc/profile is used. to switch orientation,
I use a small script in /usr/bin called switchX
---snip---
#!/bin/sh
#
# detect current screen orientation
# for use with modified /etc/init.d/x and /etc/profile
export SCREEN_NOW=`ps ax | grep Xfbdev | grep -v grep | cut -c 43-`
if [ "$SCREEN_NOW" = "240x320" ]; then
/etc/init.d/x stop && /etc/init.d/x start 320x240
else
if [ "$SCREEN_NOW" = "320x240" ]; then
/etc/init.d/x stop && /etc/init.d/x start 240x320
else
echo "Sorry, could not detect screen orientation :-(" ; exit 1
fi
fi
exit 0
---snap---
>_I've made menu items for this too. Works well :-)
yes, simply call switchX from menu ;-)
>_Only problem is , some of your environment variables get expanded
>_every time you do this , I don't remember exactly which ones.
>_I've changed this by changing the scripts to use some hardcoded stuff
>_for this. (I think LD_LIBRARY_PATH and another one ....)
ooops, didn't noticed that yet ,-)
Yes, that's because everytime /etc/init.d/x is called it sources /etc/profile.
look at the lines...
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:$PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/X11R6/lib
hmmm, I think this shouldn't be a problem when not switching too often ;-)
>_
>_
>_Jaap.
>_
byTe...
Christian
-- saved my *CE image at it's safest place... /dev/null ;-)Received on Sun Jun 17 2001 - 04:29:54 EDT
This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 17:12:27 EDT