All times are UTC-06:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat May 28, 2011 2:24 am 
Offline

Joined: Fri May 27, 2011 4:30 pm
Posts: 10
I need to just start X with firefox without anything else but maybe a screensaver, my first atempt on disabling /etc/rcS.d/S70x11-common and adding startx firefox at the end (but before exit 0) on /etc/rc.local has result on a pretty black screen and blocked system.

Any clue on how to achive my goal?


Top
   
 Post subject:
PostPosted: Sat May 28, 2011 4:59 am 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

The way I usually do these things is install some minimal window manager like AEWM (http://www.red-bean.com/decklin/aewm/) and write a script to start whatever you need.

I created the following script for Chromium, but you should be able to adapt it for Firefox. It is called chromium.sh and resides in /root in this example.
Code:
#!/bin/bash
ARG=$1
if [ "$ARG" = "start" ]
then
echo " starting chromium..."
echo $$ > /var/run/chromium.pid
#run xinit in a loop to respawn the desktop if killed
while [ -f "/var/run/chromium.pid" ]; do
xinit /root/chromium.sh &> /dev/null
sleep 1
done
rm -f /var/run/chromium.pid
else if [ "$ARG" = "stop" ]
then
rm -f /var/run/chromium.pid
killall X
else
shift
echo -e $$ > /var/run/chromium.pid
#call chromium
/usr/bin/chromium &
#run aewm as window manager
aewm -1 "aemenu --switch" -2 "aemenu --switch" -3 "aemenu --switch"
fi
fi
Which you can then run from rc.local:
Code:
/root/chromium.sh start &

By the way, Chromium might be a better choice than Firefox since it appears to be a lot faster.


Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Sun May 29, 2011 6:56 pm 
Offline

Joined: Fri May 27, 2011 4:30 pm
Posts: 10
Thanks for the reply , I selected firefox due the R-Kiosk plugin do what I was looking for and it's enough quick for may taste, but I take note on chromium

but something still doesn't work
I have desisntalled gdm ,
I have renamed /etc/rcS.d/S70x11-common to /etc/rcS.d/s70x11-common
and I try your aproach modifiying the script that way:
/root/kiosk.sh
Code:
#!/bin/bash
ARG=$1
if [ "$ARG" = "start" ]
then
echo " starting kiosk..."
echo $$ > /var/run/kiosk.pid
#run xinit in a loop to respawn the desktop if killed
while [ -f "/var/run/kiosk.pid" ]; do
xinit /root/kiosk.sh &> /dev/null
sleep 1
done
rm -f /var/run/kiosk.pid
else if [ "$ARG" = "stop" ]
then
rm -f /var/run/kiosk.pid
killall Xorg
else
shift
echo -e $$ > /var/run/kiosk.pid
#run gnome as window manager
/usr/bin/gnome-wm &
sleep 1
DISPLAY=:0.0 /usr/bin/firefox &
fi
fi
and add
/root/kiosk.sh start &
at the end of /etc/rc.local (just before exit 0)

But the result is an endless loop of trying to start X,

I have even simplified the whole thing creating a script
like this
/root/kiosk2.sh
Code:
/usr/bin/gnome-wm &
DISPLAY=:0.0 /usr/bin/firefox
and add to rc.local
Code:
xinit /root/kiosk2.sh &
with same result but of course in this case it just try once,

But the most curious of all this is that

running "xinit /root/kiosk2.sh &" from a terminal works! but it doesn't work form rc.local
What the &%&/( I'm missing?

here is the full copy of my rc.local
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//')
case "$machine" in
"Genesi Efika MX (Smartbook)")
board=efikasb
;;
"Genesi Efika MX (Smarttop)")
board=efikamx
;;
esac

if [ "${board}" = "efikamx" ]; then
if [ -f /sys/class/graphics/fb0/audio ]; then
modprobe snd-spdif
modprobe snd-soc-imx-3stack-sgtl5000
else
modprobe snd-soc-imx-3stack-sgtl5000
modprobe snd-spdif
fi
else
modprobe snd-soc-imx-3stack-sgtl5000
fi
su -
xinit /root/kiosk.sh &
exit 0


Top
   
 Post subject:
PostPosted: Mon May 30, 2011 2:55 am 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

Two things:

1) remove the & from "DISPLAY=:0.0 /usr/bin/firefox &"

2) in rc.local, put "/root/kiosk.sh start" instead of " xinit /root/kiosk.sh & " (make sure kiosk.sh is executable)


Just tried it quickly here on my netbook and it works.

Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group