Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
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 '12 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 '12 at 1:39

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/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.