2

In KDE, How do I specify which file browser Firefox uses when you select "Open Containing Folder" Fedora 17?

This is not a trivial problem, Firefox in Fedora (mine is 14.0.1) seems to hard code the file manager to use. Firefox is surprisingly stubborn to use the file manager IT wants, not the one you want.

The problem is that Firefox is a GNOME application, and is designed to run in GNOME, so when you run it in a KDE environment, it has trouble picking a file manager. I'm looking for work arounds.

My firefox insists on Dolphin, I'll have none of it, I want it to use konqueror

Screenshot:
enter image description here

3 Answers 3

1

There are two ways to fix this problem:

Option 1. Create a soft link from the dolphin binary to have it run konqueror:

cd /usr/bin
mv dolphin dolphin.bak
ln -s dolphin konqueror

Which is a disgusting hack. So Firefox goes out and thinks it's running dolphin by executing /usr/bin/dolphin, but we've tricked it into running Konqueror. Just keep in mind that a upgrade of dolphin will probably overwrite the /usr/bin/dolphin, so you'll have to re soft link it to konqueror in that event.

Option 2, try to trick firefox into asking for help with the file manager

(UPDATE -> This Option 2 only works temporally, until you restart, Firefox will switch to the file manager IT wants to use WITHOUT your consent after a restart).

In Fedora 17, Firefox might ask the user for help in picking a file manager if you yank the rug out from under it and delete the file manager it is using. In my case, Firefox was using Dolphin, so I removed it:

In a Terminal:

su
<enter password>
yum remove dolphin

Which I found out also removed terminal, konqueror and many other apps! Which made me slap my forhead, however, next time I tried to open containing folder, Firefox then presented me with this:

enter image description here

THEN, I had to reinstall konqueror with this:

yum install konqueror

which was pretty quick. I selected it in /usr/bin/konqueror. And we are good to go, Open Containing Folder uses Konqueror.

2
  • This is the best answer I found because you only need to use the ugly hack to make Firefox ask for a file manager and after that you can undo the hack. I would add 2 simple things: [1] you don't need to use the package manager, just temporarily rename the executable in /usr/bin, so that Firefox can't find it; [2] if you select /usr/bin/xdg-open and the rest of your system is already configured properly, Firefox will open the default file manager. After doing this, it started opening folders in Dolphin instead of Nautilus (Tested on Ubuntu + KDE).
    – marcus
    Aug 11, 2012 at 20:49
  • Oops, I don't know why but it reverted to Nautilus somehow... It does opens Dolphin when Nautilus is not found, but opens Nautilus otherwise. I don't know what's going on, it seems something is really hardcoded...
    – marcus
    Aug 20, 2012 at 1:39
0

Create your own custom bash script to open the correct file manager

Supplied is a bash script to determine "Who invoked dolphin", and if it was Firefox, hijack that and run a specified file manager, otherwise run a different file manager.

How to do this:

  1. Go to your user directory, mine is /usr/home/el

  2. Create a new folder there called 'bin' (if you havn't already): /usr/home/el/bin

  3. Make a new file in there called 'dolphin', it has to be named exactly what firefox is using by default, in my case: /usr/bin/dolphin.

  4. Execute this command:

    chmod u+x /home/el/bin/dolphin
    
  5. Make sure the permissions on the dolphin file are (-rwxrw-r--)

  6. Put the following lines commands into the /home/el/bin/dolphin bash file:

    #!/bin/bash
    PARENTNAME=$(ps -eo "%p %c" | grep $PPID | cut -f2 --delimiter=" ")
    if [ "$PPID" -eq "1" ]
    then
      PARENTFOLDER=$(ps -eo "%p  %a" | grep nautilus | grep no-desktop | head -n1 | sed 's/^.*file:\/\///') 
      # This is likely to contain URL-encoded strings
      PARENTFOLDER="$(echo -ne ${PARENTFOLDER//%/\\x})" 
      # ${STRING//search/replace} replaces URL-Encoded strings  (%xx) by 
      # their respective \xHH notation, which "echo -e" replaces with 
      # the appropriate character
      #konqueror "$PARENTFOLDER" --profile downloads &  #use this if you have a konqueror profile
      konqueror "/home/el/Downloads" &    #this just hardcodes a directory firefox saves to.
    else
      /usr/bin/nautilus &
    fi
    
  7. Notice the konqueror and nautilus lines, those can be changed to the file manager of your choice.

  8. In your home directory, edit your /home/el/.bashrc file. Add the following line to the end.

     PATH=/home/el/bin:$PATH
    
  9. Basically what this is doing is having the system check your /home/el/bin directory for dolphin before it searches inside /usr/bin. Setting the PATH that way means YOUR /home/el/bin/dolphin file will be executed instead of the one in /usr/bin/dolphin. The supplied code runs, and executes the correct file manager, passing along firefox's parameters.

  10. Restart the computer, run firefox, go to tools-> download manager, right click -> "Open containing folder" and boom, it defaults to konqueror.

Screenshot proof:

enter image description here

My theory as to why Linux Firefox is so stubborn in this department is to remind you: If you want the computer to hold your hand and control your existence, use Windows. If you want to be the kind of person who knows how to make magic happen under the hood, use Linux. The skills you develop in trying to subdue firefox here will serve you many times in the future when you need to glue together two different systems.

It's either that, or the firefox linux devs have done this on purpose, because they hate KDE users.

Source:

http://www.linuxquestions.org/questions/linux-software-2/firefox-iceweasel-workaround-open-containing-folder-with-user-defined-filemanager-903126/

0

You should define the xdg-open variable to open with konqueror instead.

  1. Create a *.desktop file of Konqueror. This can be done by adding Konqueror to the Desktop. In Trinity Desktop you can do this by going to T-Menu and right-clicking on Konqueror and choosing Add Item to Desktop.
  2. Move the .desktop file (mine is konqbrowser.desktop) to /usr/share/applications/ or ~/.local/share/applications/
  3. Run xdg-mime default konqbrowser.desktop inode/directory and now your directory links will be open with Konqueror.

More information can be found in here https://wiki.archlinux.org/index.php/xdg-open

NOTE: If you can't create a .desktop, create a .desktop file with a text editor, for example, a konqbrowser.desktop file, and paste this to the file:

[Desktop Entry]  
Type=Application  
Exec=kfmclient openProfile webbrowsing  
Icon=konqueror  
X-DocPath=konqueror/index.html  
Name=Konqueror

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .