Do

Folders launch Firefox?

Asked by Charles Pence

For some reason, Do has decided to launch folders using Firefox. For example, typing "Documents" into Do produces the expected output ("~/Documents" on the bottom line, and a folder icon labelled "Open" on the right); pressing enter then launches Firefox with the URL file:///home/me/Documents/.

Possible pertinent info:

* Firefox is FF3 RC1.
* My folders are configured by default to open with PCMan File Manager, not Nautilus -- but this is working fine. Folders *were* opening with PCMan just dandily a while ago.
* Running "gvfs-open ~/Documents" opens PCMan.
* "gnomevfs-info ~/Documents" reports "Default app: pcmanfm.desktop".
* I have pcmanfm.desktop hard-coded to be the default application in ~/.local/share/applications/mimeapps.list, associated with "inode/directory", "x-directory/gnome-default-handler", and "x-directory/normal".
* I have also replaced the nautilus-computer and nautilus-home desktop files with pcmanfm associations, and using Do to run "Home Folder" opens PCManFM, while using Do to run "Computer" launches Firefox with the URL "computer:" (?!?!).

So I have no clue what might make Do think this would be the right action to use on folders. Any help?

Question information

Language:
English Edit question
Status:
Solved
For:
Do Edit question
Assignee:
No assignee Edit question
Solved by:
Charles Pence
Solved:
Last query:
Last reply:
Revision history for this message
Charles Pence (cpence) said :
#1

Another useful piece of info: FF3's .desktop file does *not* have any MIME types for any of the folder MIMEs specified.

Revision history for this message
Charles Pence (cpence) said :
#2

Update: I dove into the code and realized that the File plugin actually calls the default GNOME method for opening "file://~/Documents" when it opens the folder "~/Documents". I attempted to add a GNOME Handler for the file protocol at gconf:/desktop/gnome/url-handlers/file/ pointing to pcmanfm, but this doesn't work for some reason.

Revision history for this message
Charles Pence (cpence) said :
#3

Just to add a little more detail on where I am now:

Running:

* "gnome-open /"
* "gnome-open file:///"
* "gvfs-open /"
* "gvfs-open file:///"

All open PCMan File Manager. Do is the *only* thing that opens Firefox on folders.

Revision history for this message
David Siegel (djsiegel-deactivatedaccount) said :
#4

This is pretty strange behavior. What happens if you try:

$ xdg-mime default pcman.desktop x-directory/normal

(assuming pcman.desktop is the launcher for PCMan)

Revision history for this message
Charles Pence (cpence) said :
#5

This hasn't solved the issue, but I have finally tracked down *something*. Executing "xdg-open file:///" opens Firefox.

Revision history for this message
Charles Pence (cpence) said :
#6

Aha! I think I have it (possibly). I'm not running the gnome-session daemon, so xdg-open does not set DE=gnome. Thus, xdg-open (if it's really being called by Do) runs any file:// URL in Firefox.

Testing now, will post momentarily with a possible workaround.

Revision history for this message
Charles Pence (cpence) said :
#7

OK, here's a workaround for anyone else experiencing this problem:

Under the hood somewhere, Do is calling "xdg-open" to open URLs. xdg-open detects the presence of the Gnome desktop by looking for the environment variable GNOME_DESKTOP_SESSION_ID. If you aren't running the Gnome session manager (I run Do under Fluxbox, for example), you need to set the value of GNOME_DESKTOP_SESSION_ID to something random (I do this in my .xsession file). Adding

export GNOME_DESKTOP_SESSION_ID="omg"

to my .xsession causes xdg-open to properly open URLs with "gnome-open", which uses the file associations I've already set.

I haven't experienced any other problems caused by setting this variable to a nonsense value, but I haven't tested many pieces of software.

Revision history for this message
Charles Pence (cpence) said :
#8

(As an aside, calling gnome-open directly instead of xdg-open would solve this problem without a workaround; since Do is itself a Gnome program I don't think this would cause a problem.)

Revision history for this message
David Siegel (djsiegel-deactivatedaccount) said :
#9

Do is a GNOME program, but not only a GNOME program. Calling xdg-open makes Do a better citizen in other DEs.

Revision history for this message
JorgeAzevedo (cenomail) said :
#10

I know this isn't probably where I should ask, but I'm trying to configure gnome-do to work with pcmanfm in lxde. Can you explain or direct me to where I can find the info on how to configure gnome-open and all the others? Thx in advance.

Revision history for this message
BrokenTusk (dave-meyer) said :
#11

Here is the bare-bones solution:

Adding this env variable to a session (ie: add to ~/.profile):
export DE="gnome"
makes the OPEN action (using xdg-open) default to Gnome's preferred application settings
which will use the MIME associations set in ~/.local/share/applications/defaults.list

NOTE: you must kill and restart gnome-do for chgs to take affect