It sounds like you're experiencing an issue on your Debian system where the browser's "Show in folder" or "Open containing folder" option for downloaded files is not behaving as expected. Instead of opening the file manager (in your case, PCmanFM), it's defaulting to a text editor. This is likely due to the default application for handling directories (MIME type inode/directory) not being set correctly.
Don't worry—I'll guide you through the steps to set PCmanFM as the default file manager for this action. We'll use the XDG utilities, which are standard on Debian for managing default applications.
Step 1: Ensure PCmanFM is Installed
First, make sure PCmanFM is installed on your system. If it's not, install it using the package manager.
sudo apt update
sudo apt install pcmanfm
If it's already installed, this command will simply confirm it.
Step 2: Set PCmanFM as the Default File Manager
To fix the issue, we need to associate the MIME type for directories (inode/directory) with PCmanFM. This will ensure that when your browser tries to "show in folder," it uses PCmanFM instead of a text editor.
Run the following command in your terminal:
xdg-mime default pcmanfm.desktop inode/directory
- This command tells the system to use the PCmanFM desktop entry (
pcmanfm.desktop) for handling directories.
- The
.desktop file is usually located in /usr/share/applications/. If it's not there, double-check that PCmanFM is installed correctly.
Step 3: Verify the Change
After running the command, test it out:
- Download a file in your browser (e.g., Firefox or Chromium).
- Right-click the downloaded file in the browser's download list and select "Show in folder" or "Open containing folder."
- It should now open the folder in PCmanFM.
If it still doesn't work:
Additional Troubleshooting
If the above steps don't resolve the issue, here are some common reasons and fixes:
-
Browser-Specific Settings:
- Some browsers (like Firefox) might have their own settings for handling downloads. In Firefox, for example:
- Go to Menu > Preferences > General > Files and Applications.
- Look for actions related to downloads and ensure it's set to use the system default.
- In Chromium-based browsers (e.g., Chrome, Brave):
- Go to Settings > Advanced > Downloads, and check if there's an option to reset or change the behavior.
-
Desktop Environment Conflicts:
- If you're using a desktop environment like GNOME, KDE, or XFCE, it might override XDG settings. For instance:
- In XFCE (which often uses PCmanFM), you can go to Settings > Preferred Applications and set PCmanFM as the file manager.
- In GNOME, you might need to use
gnome-control-center or edit settings via the command line.
- If you're on a minimal Debian setup without a full desktop environment, ensure you're running a window manager that supports XDG (e.g., LXDE or XFCE).
-
Reset MIME Associations:
-
Check for Errors:
- If you get an error like "No such file or directory" when running the
xdg-mime command, it might mean the pcmanfm.desktop file is missing. Search for it with:
locate pcmanfm.desktop
If it's not found, reinstall PCmanFM.
Why This Happens
This issue often occurs because Debian's default setup (especially in environments like GNOME) might associate directories with a text editor or another application if no explicit file manager is set. By using xdg-mime, we're explicitly telling the system to use PCmanFM.
If you run into any errors or need more specific help (e.g., based on your desktop environment), feel free to provide more details, such as which browser you're using or what desktop environment you're on (e.g., GNOME, XFCE). I'll be happy to assist further! 😊