Firefox at startup in multiple x sessions

Asked by Mike Wszalek

Running Ubuntu 10.04 and using dual displays as separate x sessions. I need to launch Firefox as a kiosk (using r-kiosk) on each of the two displays at startup. I can launch each one manually by running from terminal:

DISPLAY=:0.1 firefox -P "profile1" -no-remote "local_filename1"

and in a separate terminal

DISPLAY=:0.0 firefox -P "profile2" -no-remote "local_filename2"

This does exactly what I need it to do, however if I try and add these as command to Startup Applications neither one launches at all. I tried adding them to /etc/rc.local, and neither launches. I tried using

firefox -display 0.1 ...

and

 firefox -display :0.1 ...

but neither of those seem to work either.

Basically I need to launch two separate instances of Firefox, one in each session every time the machine boots. Is there somewhere else I can add the lines that start with DISPLAY= so that it will run it the same way it runs in terminal?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu firefox Edit question
Assignee:
No assignee Edit question
Solved by:
Mike Wszalek
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You don't add then in rc.local as the x server needs to be running. If you make a .desktop file like the ones in /usr/share/applications

and put it in ~/.configure/autostart and it will run after the user logs in

Revision history for this message
Mike Wszalek (mwszalek) said :
#2

It launches firefox from a .desktop file as long as I don't put the "DISPLAY=" at the beginning of the command, but that doesn't allow me to launch each copy in a different window. Is there some other way to tell it which screen to start in?

Revision history for this message
Mike Wszalek (mwszalek) said :
#3

Solved the problem. I wrote two separate shell scripts using the original commands that worked, then added them to two .desktop files in ~/.config/autostart. I could have done both command in one script with an "&", but i wanted to control each individually.